@tailwind base;
@tailwind components;
@tailwind utilities;

/* LINE Seed Sans TH — วางไฟล์ .woff2 / .woff ในโฟลเดอร์ /font ที่รากโปรเจกต์ (ข้างๆ public/) */
@font-face {
  font-family: 'LINESeedSansTH';
  src: url('../../font/LINESeedSansTH_W_Th.woff2') format('woff2'),
       url('../../font/LINESeedSansTH_W_Th.woff') format('woff');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESeedSansTH';
  src: url('../../font/LINESeedSansTH_W_Rg.woff2') format('woff2'),
       url('../../font/LINESeedSansTH_W_Rg.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESeedSansTH';
  src: url('../../font/LINESeedSansTH_W_Bd.woff2') format('woff2'),
       url('../../font/LINESeedSansTH_W_Bd.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESeedSansTH';
  src: url('../../font/LINESeedSansTH_W_XBd.woff2') format('woff2'),
       url('../../font/LINESeedSansTH_W_XBd.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESeedSansTH';
  src: url('../../font/LINESeedSansTH_W_He.woff2') format('woff2'),
       url('../../font/LINESeedSansTH_W_He.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'LINESeedSansTH', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  background-color: #f8fafc;
  color: #334155;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

.hope-main-content {
  min-width: 0;
  width: 100%;
}

/* Mood & Tone: ขาว · ม่วง · ตัดเหลือง */
.celete-main-bg {
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.98) 0%, rgba(245, 243, 255, 0.95) 45%, #fafafa 100%);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0; /* ไม่ต้องมี padding บน desktop */
  }
}

/* Safe area สำหรับ iPhone */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

.lux-gradient {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(196, 181, 253, 0.45) 0%, transparent 58%),
    radial-gradient(760px 420px at 18% 28%, rgba(234, 179, 8, 0.14) 0%, transparent 62%),
    radial-gradient(760px 420px at 82% 28%, rgba(124, 58, 237, 0.12) 0%, transparent 62%),
    radial-gradient(900px 520px at 50% 110%, rgba(254, 240, 138, 0.2) 0%, transparent 65%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 55%, #f5f3ff 100%);
}

.lux-border {
  border-image: linear-gradient(to right, #7c3aed, #c4b5fd, #fde047, #a855f7) 1;
}

.glass-dark {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.gold-text {
  background: linear-gradient(to right, #5b21b6, #7c3aed, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

/* หัวข้อแบรนด์ + เมนู active ในแถบ header — สีหลัก #7630d7 */
header .gold-text {
  background: linear-gradient(to right, #7630d7, #8b5cf6, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.gold-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, rgba(167, 139, 250, 0.45), rgba(251, 113, 133, 0.45), rgba(167, 139, 250, 0.45), transparent);
  margin: 1rem 0;
}

.card-lux {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid rgba(124, 58, 237, 0.14);
  box-shadow:
    0 18px 50px rgba(91, 33, 182, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: all 0.3s ease;
}

.card-lux:hover {
  border-color: rgba(234, 179, 8, 0.45);
  box-shadow:
    0 22px 60px rgba(91, 33, 182, 0.1),
    0 0 0 1px rgba(196, 181, 253, 0.35);
}

/* =========================
   Admin theme switcher
   ========================= */
.admin-theme-light {
  color: #4c1d95;
  background-color: #faf5ff !important;
}

/* override tailwind bg-black on body when admin switches to light */
.admin-theme-light.bg-black {
  background-color: #faf5ff !important;
}

/* common admin form surfaces (inputs/selects/textareas often use bg-black/60) */
.admin-theme-light input,
.admin-theme-light select,
.admin-theme-light textarea {
  background-color: #ffffff !important;
  color: #4c1d95 !important;
}

.admin-theme-light input::placeholder,
.admin-theme-light textarea::placeholder {
  color: rgba(91, 33, 182, 0.45) !important;
}

.admin-theme-light input:focus,
.admin-theme-light select:focus,
.admin-theme-light textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

/* Tailwind black-alpha backgrounds used heavily in admin UI (search/filter). Override to beige tone. */
.admin-theme-light .bg-black\/70,
.admin-theme-light .bg-black\/60,
.admin-theme-light .bg-black\/50,
.admin-theme-light .bg-black\/40,
.admin-theme-light .bg-black\/30,
.admin-theme-light .bg-black\/20 {
  background-color: #f5f3ff !important;
}

/* Hover states in admin still use tailwind hover:bg-black/..; keep them light */
.admin-theme-light .hover\:bg-black\/60:hover,
.admin-theme-light .hover\:bg-black\/50:hover,
.admin-theme-light .hover\:bg-black\/40:hover,
.admin-theme-light .hover\:bg-black\/30:hover,
.admin-theme-light .hover\:bg-black\/20:hover {
  background-color: #ede9fe !important;
}

.admin-theme-light .lux-gradient {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(196, 181, 253, 0.35) 0%, transparent 60%),
    radial-gradient(760px 420px at 20% 25%, rgba(234, 179, 8, 0.1) 0%, transparent 62%),
    radial-gradient(760px 420px at 80% 25%, rgba(124, 58, 237, 0.1) 0%, transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #faf5ff 70%, #f5f3ff 100%);
}

.admin-theme-light .glass-dark {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 243, 255, 0.9));
  border: 1px solid rgba(124, 58, 237, 0.15);
  color: #5b21b6;
}

/* Sidebar nav text: brown tone */
.admin-theme-light aside.glass-dark .text-slate-400,
.admin-theme-light aside.glass-dark .text-slate-500,
.admin-theme-light aside.glass-dark .text-slate-300 {
  color: #6d28d9 !important;
  opacity: 1;
}
.admin-theme-light aside.glass-dark nav a.text-slate-400 {
  color: #6d28d9 !important;
}
.admin-theme-light aside.glass-dark nav a:hover,
.admin-theme-light aside.glass-dark nav a.hover\:text-\[\#7c3aed\]:hover {
  color: #ca8a04 !important;
}
/* Active menu item */
.admin-theme-light aside.glass-dark nav a.text-\[\#7c3aed\] {
  color: #5b21b6 !important;
}
.admin-theme-light aside.glass-dark .gold-text {
  color: #5b21b6 !important;
}
/* Logout link stays red on hover */
.admin-theme-light aside.glass-dark nav a.hover\:text-red-400:hover {
  color: #dc2626 !important;
}

.admin-theme-light .card-lux {
  background: linear-gradient(160deg, #ffffff, #faf5ff);
  border: 1px solid rgba(124, 58, 237, 0.18);
  box-shadow:
    0 18px 55px rgba(91, 33, 182, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* text-slate overrides moved to comprehensive section below */
.admin-theme-light .text-slate-600,
.admin-theme-light .text-slate-700,
.admin-theme-light .text-slate-800,
.admin-theme-light .text-slate-900 {
  color: #4c1d95 !important;
  opacity: 1;
}

.admin-theme-light .border-slate-700\/60,
.admin-theme-light .border-slate-800\/80,
.admin-theme-light .border-slate-800\/70 {
  border-color: rgba(124, 58, 237, 0.2) !important;
}

/* Some pages use darker border/text combos (e.g. text-slate-700, border-slate-600/700/800). */
.admin-theme-light .border-slate-700\/70,
.admin-theme-light .border-slate-700\/60,
.admin-theme-light .border-slate-700\/40,
.admin-theme-light .border-slate-600\/30,
.admin-theme-light .border-slate-600\/40,
.admin-theme-light .border-slate-800\/60,
.admin-theme-light .border-slate-800\/50,
.admin-theme-light .border-slate-800\/40 {
  border-color: rgba(124, 58, 237, 0.2) !important;
}

/* Setting field wrapper with icon */
.admin-theme-light .setting-field-wrap {
  background-color: #ffffff;
  border-color: rgba(124, 58, 237, 0.22) !important;
}
.admin-theme-light .setting-field-wrap:focus-within {
  border-color: rgba(124, 58, 237, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.admin-theme-light .setting-field-wrap input,
.admin-theme-light .setting-field-wrap select,
.admin-theme-light .setting-field-wrap textarea {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #4c1d95 !important;
}

/* ================================================
   Admin Light Theme: Tables, Badges, Buttons, Icons
   ================================================ */

/* --- Text colors: violet tones --- */
.admin-theme-light .text-slate-100,
.admin-theme-light .text-slate-200 {
  color: #4c1d95 !important;
  opacity: 1;
}
.admin-theme-light .text-slate-300 {
  color: #5b21b6 !important;
  opacity: 1;
}
.admin-theme-light .text-slate-400 {
  color: #6d28d9 !important;
  opacity: 1;
}
.admin-theme-light .text-slate-500 {
  color: #7c3aed !important;
  opacity: 1;
}

/* Keep sidebar overrides (they use aside-specific rules above) */

/* --- gold-text in admin --- */
.admin-theme-light .gold-text {
  background: linear-gradient(135deg, #5b21b6, #7c3aed, #a855f7) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* --- Status badges (warm palette) --- */
.admin-theme-light .bg-emerald-200 { background-color: #d4edda !important; }
.admin-theme-light .text-emerald-900 { color: #1e5631 !important; opacity: 1; }
.admin-theme-light .border-emerald-500 { border-color: #6abf7b !important; }

.admin-theme-light .bg-amber-200 { background-color: #fef3c7 !important; }
.admin-theme-light .text-amber-900 { color: #78350f !important; opacity: 1; }
.admin-theme-light .border-amber-500 { border-color: #d4a037 !important; }
.admin-theme-light .border-amber-400 { border-color: #d4a037 !important; }
.admin-theme-light .bg-amber-100 { background-color: rgb(245 238 214) !important; }
.admin-theme-light .bg-amber-500\/15 { background-color: rgba(181, 120, 46, 0.2) !important; }
.admin-theme-light .border-amber-500\/30 { border-color: rgba(181, 120, 46, 0.45) !important; }

.admin-theme-light .bg-rose-200 { background-color: #fde2e2 !important; }
.admin-theme-light .text-rose-900 { color: #7f1d1d !important; opacity: 1; }
.admin-theme-light .border-rose-500 { border-color: #e8a0a0 !important; }

/* --- Icon flag boxes (ebooks list: featured/recommended/new) --- */
.admin-theme-light .bg-\[\#7c3aed\]\/10 {
  background-color: rgba(124, 58, 237, 0.12) !important;
}

/* Admin — สถานะหน้าแรก (toggle cards) */
.hope-admin-flag-card {
  display: block;
}

.hope-admin-flag-card__box {
  position: relative;
  padding: 1rem;
  border-radius: 0.875rem;
  border: 2px solid rgba(124, 58, 237, 0.18);
  background: #ffffff;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.hope-admin-flag-card__box:hover {
  border-color: rgba(124, 58, 237, 0.35);
  background: #faf5ff;
}

.hope-admin-flag-card__check {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  background: #7c3aed;
  color: #fff;
  font-size: 0.55rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hope-admin-flag-card:has(input:checked) .hope-admin-flag-card__box {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.hope-admin-flag-card:has(input:checked) .hope-admin-flag-card__check {
  opacity: 1;
  transform: scale(1);
}

.hope-admin-flag-card--featured:has(input:checked) .hope-admin-flag-card__box {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.hope-admin-flag-card--recommend:has(input:checked) .hope-admin-flag-card__box {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.hope-admin-flag-card--recommend:has(input:checked) .hope-admin-flag-card__check {
  background: #f43f5e;
}

.hope-admin-flag-card--new:has(input:checked) .hope-admin-flag-card__box {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.hope-admin-flag-card--new:has(input:checked) .hope-admin-flag-card__check {
  background: #0ea5e9;
}

.hope-admin-toggle__ui {
  display: inline-flex;
  min-width: 4.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  color: #64748b;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.hope-admin-toggle:has(input:checked) .hope-admin-toggle__ui {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.hope-admin-toggle__on {
  display: none;
}

.hope-admin-toggle:has(input:checked) .hope-admin-toggle__off {
  display: none;
}

.hope-admin-toggle:has(input:checked) .hope-admin-toggle__on {
  display: inline;
}
.admin-theme-light .border-\[\#7c3aed\]\/30 {
  border-color: rgba(124, 58, 237, 0.35) !important;
}
.admin-theme-light .bg-rose-500\/10 {
  background-color: rgba(220, 120, 100, 0.12) !important;
}
.admin-theme-light .border-rose-500\/25 {
  border-color: rgba(200, 120, 100, 0.35) !important;
}
.admin-theme-light .bg-sky-500\/10,
.admin-theme-light .bg-sky-500\/15 {
  background-color: rgba(42, 122, 181, 0.18) !important;
}
.admin-theme-light .border-sky-500\/25,
.admin-theme-light .border-sky-500\/30 {
  border-color: rgba(42, 122, 181, 0.45) !important;
}
.admin-theme-light .text-sky-300 {
  color: #1e5a8a !important;
  opacity: 1;
}

/* Inactive icon flags */
.admin-theme-light .text-slate-500 i.fa-crown,
.admin-theme-light .text-slate-500 i.fa-star,
.admin-theme-light .text-slate-500 i.fa-sparkles,
.admin-theme-light .text-slate-500 i.fa-gift,
.admin-theme-light .text-slate-500 i.fa-calendar-check {
  color: #c4b08a !important;
}

/* --- Action buttons: warm brown theme --- */
.admin-theme-light .bg-\[\#7c3aed\]\/20 {
  background-color: rgba(124, 58, 237, 0.15) !important;
}
.admin-theme-light .bg-\[\#7c3aed\]\/30 {
  background-color: rgba(124, 58, 237, 0.22) !important;
}
.admin-theme-light .bg-red-900\/20,
.admin-theme-light .bg-red-900\/30 {
  background-color: rgba(180, 60, 60, 0.12) !important;
}
.admin-theme-light .text-red-400 {
  color: #b33a3a !important;
  opacity: 1;
}

/* Delete button */
.admin-theme-light button.bg-rose-200 {
  background-color: rgba(200, 100, 100, 0.15) !important;
  color: #a04040 !important;
  border-color: rgba(180, 80, 80, 0.3) !important;
}
.admin-theme-light button.bg-rose-200:hover,
.admin-theme-light .hover\:bg-rose-300:hover {
  background-color: rgba(200, 100, 100, 0.25) !important;
}

/* Toggle status button */
.admin-theme-light button.bg-amber-200 {
  background-color: rgba(124, 58, 237, 0.18) !important;
  color: #78350f !important;
}
.admin-theme-light button.bg-emerald-200 {
  background-color: rgba(72, 160, 100, 0.15) !important;
  color: #1e5631 !important;
}

/* --- Price badge --- */
.admin-theme-light span.bg-amber-200 {
  background-color: rgba(212, 175, 55, 0.2) !important;
  color: #6b3a0a !important;
}

/* --- Table background tints --- */
.admin-theme-light .bg-black\/30,
.admin-theme-light .bg-black\/40 {
  background-color: rgba(124, 58, 237, 0.08) !important;
}
.admin-theme-light .border-slate-800\/70,
.admin-theme-light .border-slate-800\/80,
.admin-theme-light .border-slate-800\/60,
.admin-theme-light .border-slate-800\/50 {
  border-color: rgba(124, 58, 237, 0.2) !important;
}
.admin-theme-light tr:hover .bg-black\/40,
.admin-theme-light .hover\:bg-black\/40:hover {
  background-color: rgba(124, 58, 237, 0.1) !important;
}

/* --- Stats cards tints --- */
.admin-theme-light .text-emerald-300 {
  color: #2d8a52 !important;
  opacity: 1;
}
.admin-theme-light .text-amber-300 {
  color: #a67c2e !important;
  opacity: 1;
}

/* --- Order status select --- */
.admin-theme-light select.bg-amber-100 {
  background-color: rgb(245 238 214) !important;
  color: #5a3e1b !important;
  border-color: rgba(124, 58, 237, 0.45) !important;
}

/* --- Modal overlays --- */
.admin-theme-light .bg-black\/70 {
  background-color: rgba(40, 30, 15, 0.6) !important;
}
.admin-theme-light .bg-black\/60 {
  background-color: rgba(124, 58, 237, 0.06) !important;
}

/* --- Ebook rating star color stays gold --- */
.admin-theme-light .text-\[\#eab308\] {
  color: #ca8a04 !important;
  opacity: 1;
}

/* --- Dashboard specific --- */
.admin-theme-light .text-emerald-400 { color: #2d8a52 !important; opacity: 1; }
.admin-theme-light .text-rose-400 { color: #b33a3a !important; opacity: 1; }
.admin-theme-light .text-sky-400 { color: #2a7ab5 !important; opacity: 1; }
.admin-theme-light .text-amber-400 { color: #a67c2e !important; opacity: 1; }
.admin-theme-light .bg-emerald-400 { background-color: #2d8a52 !important; }
.admin-theme-light .bg-rose-400 { background-color: #c05050 !important; }
.admin-theme-light .bg-amber-400 { background-color: #d4a037 !important; }

/* Emerald/rose/amber badge combos in tables */
.admin-theme-light .bg-emerald-500\/15 { background-color: rgba(45, 138, 82, 0.12) !important; }
.admin-theme-light .border-emerald-500\/30 { border-color: rgba(45, 138, 82, 0.3) !important; }
.admin-theme-light .text-emerald-300 { color: #2d8a52 !important; opacity: 1; }
.admin-theme-light .bg-rose-500\/15 { background-color: rgba(180, 60, 60, 0.1) !important; }
.admin-theme-light .border-rose-500\/30 { border-color: rgba(180, 60, 60, 0.25) !important; }
.admin-theme-light .text-rose-300 { color: #b33a3a !important; opacity: 1; }

.section-title-gold {
  color: #6d28d9;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 1.125rem;
}

/* Search button animation */
.bg-size-200 {
  background-size: 200% 200%;
}

.bg-pos-0 {
  background-position: 0% 50%;
}

.bg-pos-100 {
  background-position: 100% 50%;
}

/* Scrollbar hide for category section */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ========== Front theme: ขาว · ม่วง · เหลืองตัด ========== */
/* หัวข้อ section บนพื้นอ่อน (ไม่ครอบคลุมการ์ดทับรูป) */
.vio-theme .section-heading-on-light {
  color: #4c1d95 !important;
}
.vio-theme .border-slate-800\/80,
.vio-theme .border-slate-800\/60 {
  border-color: rgba(196, 181, 253, 0.45) !important;
}

/* =====================================================================
   HOPE SPACE — Mood & Tone
   โทนสว่าง · ม่วงพาสเทล · คอรัล/ส้ม · พื้นหลังลาเวนเดอร์นุ่ม
   ===================================================================== */
:root {
  --hope-purple: #8b5cf6;
  --hope-purple-deep: #7c3aed;
  --hope-purple-soft: #a78bfa;
  --hope-coral: #fb7185;
  --hope-coral-warm: #fb7a51;
  --hope-ink: #2c2a4a;
  --hope-bg: #fbfaff;
}

/* พื้นหลังหลักของหน้า — ลาเวนเดอร์/ขาวนุ่ม พร้อม blob พาสเทล */
.vio-theme {
  background-color: var(--hope-bg);
}

.hope-page-bg {
  background:
    radial-gradient(720px 520px at 88% -4%, rgba(251, 113, 133, 0.16) 0%, transparent 60%),
    radial-gradient(620px 480px at 8% 6%, rgba(167, 139, 250, 0.18) 0%, transparent 58%),
    radial-gradient(760px 560px at 50% 116%, rgba(196, 181, 253, 0.20) 0%, transparent 64%),
    linear-gradient(180deg, #fdfcff 0%, #faf8ff 50%, #f7f4ff 100%);
}

/* ฟอนต์สคริปต์สำหรับคำเน้นใน headline (Create, / and Grow.) */
.hope-script {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  line-height: 1.05;
}

/* Headline หลัก */
.hope-h1 {
  color: var(--hope-ink);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hope-text-coral {
  background: linear-gradient(90deg, #fb7185 0%, #fb7a51 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hope-text-purple {
  background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Pill badge ลอยเหนือหัวข้อ */
.hope-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 24px -12px rgba(124, 58, 237, 0.35);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  font-weight: 600;
  color: #6d28d9;
}

/* ปุ่มหลัก gradient ม่วง→คอรัล */
.hope-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(95deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  box-shadow: 0 16px 34px -12px rgba(124, 58, 237, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.hope-btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 22px 42px -12px rgba(124, 58, 237, 0.6);
}

/* ปุ่มรอง / pill ขอบ */
.hope-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  border-radius: 9999px;
  color: #4c1d95;
  font-weight: 600;
  transition: color 0.2s ease;
}

/* การ์ดแก้วนุ่ม Hope Space */
.hope-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px -28px rgba(124, 58, 237, 0.28);
  backdrop-filter: blur(10px);
}

/* แถบ navbar ขาวสว่าง */
.hope-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.18);
  box-shadow: 0 8px 30px -22px rgba(124, 58, 237, 0.45);
}

.hope-nav-link {
  color: #2c2a4a;
  font-size: 0.975rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.hope-nav-link:hover {
  color: #7c3aed;
  background: rgba(245, 243, 255, 0.9);
}

.hope-nav-link--active {
  color: #fb7185;
}

.hope-nav-link--active:hover {
  color: #fb7185;
  background: rgba(254, 242, 244, 0.85);
}

/* ไอคอนเมนูสีสัน — วงกลม gradient */
.hope-nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 6px 14px -7px rgba(124, 58, 237, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hope-nav-link:hover .hope-nav-ico {
  transform: translateY(-1px) scale(1.08);
}

.hope-nav-ico--coral  { background: radial-gradient(circle at 30% 25%, #fda4af, #fb7185 75%); }
.hope-nav-ico--purple { background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 75%); }
.hope-nav-ico--tech   { background: radial-gradient(circle at 30% 25%, #93c5fd, #6366f1 75%); }
.hope-nav-ico--health { background: radial-gradient(circle at 30% 25%, #86efac, #34d399 75%); }
.hope-nav-ico--gold   { background: radial-gradient(circle at 30% 25%, #fcd34d, #fb923c 75%); }

.hope-btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1.25rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(95deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  box-shadow: 0 12px 26px -12px rgba(124, 58, 237, 0.6);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.hope-btn-nav:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

/* Mobile bottom nav — Hope Space theme */
.hope-bottom-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow: 0 -8px 30px -18px rgba(124, 58, 237, 0.35);
}

.hope-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 3.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  transition: color 0.2s ease;
}

.hope-bottom-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.hope-bottom-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(245, 243, 255, 0.85);
  color: #7c3aed;
  font-size: 1.125rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hope-bottom-item:active .hope-bottom-icon {
  transform: scale(0.95);
}

.hope-bottom-item--active .hope-bottom-label,
.hope-bottom-item--active .hope-bottom-icon {
  color: #fb7185;
}

.hope-bottom-item--active .hope-bottom-icon {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(254, 242, 244, 0.95);
}

.hope-bottom-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -1.5rem;
}

.hope-bottom-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.5rem;
  width: 3.5rem;
  border-radius: 1rem;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #fb7185 100%);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  transition: transform 0.2s ease;
}

.hope-bottom-home-btn:active {
  transform: scale(0.95);
}

.hope-bottom-home-label {
  margin-top: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #94a3b8;
}

.hope-bottom-item--active.hope-bottom-home .hope-bottom-home-label,
.hope-bottom-home--active .hope-bottom-home-label {
  color: #fb7185;
}

/* เมนู pill ลอยใต้ navbar */
.hope-subnav {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 9999px;
  box-shadow: 0 14px 36px -22px rgba(124, 58, 237, 0.4);
}

/* ไอคอนหมวดหมู่วงกลม watercolor */
.hope-cat-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4.5rem;
  width: 4.5rem;
  border-radius: 9999px;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 16px 30px -16px rgba(124, 58, 237, 0.45);
  transition: transform 0.3s ease;
}
.group:hover .hope-cat-icon { transform: translateY(-4px) scale(1.05); }

@media (max-width: 767px) {
  .hope-cat-icon {
    height: 3rem;
    width: 3rem;
    font-size: 1.05rem;
    box-shadow: 0 10px 22px -14px rgba(124, 58, 237, 0.38);
  }

  .group:hover .hope-cat-icon {
    transform: translateY(-2px) scale(1.04);
  }
}

@media (max-width: 374px) {
  .hope-cat-icon {
    height: 2.65rem;
    width: 2.65rem;
    font-size: 0.95rem;
  }
}

.hope-cat-design   { background: radial-gradient(circle at 30% 25%, #fda4af, #fb7185 70%); }
.hope-cat-business { background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 70%); }
.hope-cat-tech     { background: radial-gradient(circle at 30% 25%, #93c5fd, #6366f1 70%); }
.hope-cat-personal { background: radial-gradient(circle at 30% 25%, #d8b4fe, #a855f7 70%); }
.hope-cat-health   { background: radial-gradient(circle at 30% 25%, #86efac, #34d399 70%); }
.hope-cat-extra    { background: radial-gradient(circle at 30% 25%, #fcd34d, #fb923c 70%); }

/* ก้อนทรงกลมตกแต่ง (decorative sphere) */
.hope-sphere {
  border-radius: 9999px;
  background: radial-gradient(circle at 32% 28%, #c4b5fd, #8b5cf6 75%);
  box-shadow: 0 20px 40px -16px rgba(124, 58, 237, 0.45);
}

/* แถบ testimonial gradient */
.hope-testimonial {
  background:
    radial-gradient(600px 400px at 85% 120%, rgba(251, 146, 60, 0.45) 0%, transparent 60%),
    linear-gradient(120deg, #7c3aed 0%, #8b5cf6 42%, #c084fc 78%, #f0abfc 100%);
}

/* Progress bar */
.hope-progress { background: rgba(167, 139, 250, 0.18); border-radius: 9999px; height: 6px; overflow: hidden; }
.hope-progress > span { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #8b5cf6, #fb7185); }

/* หน้ารายการ (catalog / new-arrivals / bestsellers / articles) */
.hope-page-wrap {
  min-height: 60vh;
  padding-bottom: 3rem;
}

.hope-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #3f3d56;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.hope-chip:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(245, 243, 255, 0.95);
  color: #7c3aed;
  box-shadow: 0 8px 20px -14px rgba(124, 58, 237, 0.45);
}

.hope-chip-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(95deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  box-shadow: 0 12px 26px -12px rgba(124, 58, 237, 0.55);
}

.hope-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  font-size: 0.875rem;
  color: #2c2a4a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hope-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.hope-article-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px -28px rgba(124, 58, 237, 0.28);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.hope-article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 113, 133, 0.35);
  box-shadow: 0 24px 60px -24px rgba(124, 58, 237, 0.38);
}

/* หน้าบทความ — ลูกเล่น bg ตาม Hope Space theme */
.hope-articles-page {
  position: relative;
  overflow: hidden;
}

.hope-articles-page .hope-articles-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(139, 92, 246, 0.14) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, transparent 92%);
}

.hope-articles-page .hope-articles-glow {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  filter: blur(64px);
}

.hope-articles-page .hope-articles-glow--coral {
  top: -4rem;
  right: -3rem;
  width: 22rem;
  height: 22rem;
  background: rgba(251, 113, 133, 0.2);
}

.hope-articles-page .hope-articles-glow--purple {
  top: 28%;
  left: -5rem;
  width: 20rem;
  height: 20rem;
  background: rgba(167, 139, 250, 0.22);
}

.hope-articles-page .hope-articles-glow--soft {
  bottom: 0;
  right: 15%;
  width: 18rem;
  height: 18rem;
  background: rgba(196, 181, 253, 0.18);
}

.hope-articles-page .hope-articles-ring {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.hope-articles-page .hope-articles-content {
  position: relative;
  z-index: 1;
}

/* Sticky AI — mascot นั่งบนปุ่มลอย + โบกมือ */
.hope-sticky-ai-stack {
  padding-top: 5.5rem;
}

.hope-sticky-ai-mascot {
  position: absolute;
  top: 0;
  right: 0.5rem;
  z-index: 2;
  width: 6rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(124, 58, 237, 0.4));
  animation: hope-mascot-wave 2.6s ease-in-out infinite;
  transform-origin: 52% 92%;
}

.hope-sticky-ai-btn {
  position: relative;
  z-index: 1;
}

.hope-sticky-ai-stack:hover .hope-sticky-ai-mascot {
  animation-duration: 1.8s;
}

@keyframes hope-mascot-wave {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  15% {
    transform: rotate(6deg) translateY(-3px);
  }
  30% {
    transform: rotate(-4deg) translateY(-1px);
  }
  45% {
    transform: rotate(7deg) translateY(-4px);
  }
  60% {
    transform: rotate(-3deg) translateY(-2px);
  }
  75% {
    transform: rotate(5deg) translateY(-3px);
  }
}

@media (min-width: 768px) {
  .hope-sticky-ai-stack {
    padding-top: 6.5rem;
  }

  .hope-sticky-ai-mascot {
    right: 0.65rem;
    width: 7rem;
  }
}

/* Hero banner slider — mobile 1 รูป/slide, desktop 3 รูป/slide (แสดงเต็มภาพ) */
.hb-slider {
  width: 100%;
  background: #fff;
}

.hb-slider .hb-slide {
  align-items: stretch;
}

.hb-slider .hb-item {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: #f8fafc;
}

.hb-slider .hb-item--empty {
  background: #f1f5f9;
  pointer-events: none;
}

.hb-slider .hb-item-progress {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  width: 0;
  background: #10b981;
  pointer-events: none;
}

.hb-slider .hb-item-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.hb-slider .hb-item-fallback {
  width: 100%;
  min-height: 140px;
}

/* Mobile: 1 banner เต็มความกว้าง */
.hb-slider--mobile .hb-slide {
  gap: 0;
}

.hb-slider--mobile .hb-item {
  width: 100%;
}

.hb-slider--mobile .hb-item-img {
  max-height: 70vh;
}

.hb-slider--mobile .hb-item-fallback {
  min-height: 160px;
}

.hb-slider--mobile .hb-prev,
.hb-slider--mobile .hb-next {
  display: flex !important;
  height: 2rem;
  width: 2rem;
  opacity: 0.92;
}

.hb-slider--mobile .hb-dots {
  padding-top: 0.5rem;
  padding-bottom: 0.625rem;
}

/* Desktop: 3 banners ต่อ slide — แต่ละช่อง 1/3 แสดงรูปครบ */
.hb-slider--desktop .hb-item {
  flex: 1 1 0;
  min-width: 0;
  min-height: clamp(140px, 22vw, 320px);
}

.hb-slider--desktop .hb-item-img {
  max-width: 100%;
  max-height: clamp(140px, 22vw, 320px);
  width: auto;
  height: auto;
}

.hb-slider--desktop .hb-item-fallback {
  min-height: clamp(140px, 22vw, 320px);
}

@media (min-width: 768px) {
  .hb-slider--desktop .hb-prev,
  .hb-slider--desktop .hb-next {
    display: flex !important;
  }
}

.hb-slider .hb-dot {
  border: none;
  padding: 0;
  cursor: pointer;
  min-width: 0.5rem;
  min-height: 0.5rem;
}

/* ===== MR.HOPE AI Modal ===== */
.hope-ai-modal-panel {
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(251, 113, 133, 0.08) 0%, transparent 60%),
    radial-gradient(480px 300px at 0% 100%, rgba(139, 92, 246, 0.10) 0%, transparent 58%),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow: 0 32px 80px -24px rgba(124, 58, 237, 0.35);
  backdrop-filter: blur(12px);
}

.hope-ai-modal-header {
  border-bottom: 1px solid rgba(167, 139, 250, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.hope-ai-brand-icon {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 55%, #fb7185 120%);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.55);
}

.hope-ai-brand-name {
  color: var(--hope-ink);
  letter-spacing: 0.04em;
}

.hope-ai-badge {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.hope-ai-title {
  color: var(--hope-ink);
  letter-spacing: -0.02em;
}

.hope-ai-title-accent {
  background: linear-gradient(90deg, #7c3aed 0%, #fb7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hope-ai-progress-track {
  background: rgba(196, 181, 253, 0.25);
}

.hope-ai-progress-bar {
  background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
}

.hope-ai-opt {
  border: 1px solid rgba(196, 181, 253, 0.45);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hope-ai-opt:hover {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(245, 243, 255, 0.95);
  box-shadow: 0 10px 28px -16px rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}

.hope-ai-opt--selected {
  border-color: #8b5cf6;
  background: rgba(245, 243, 255, 0.98);
  box-shadow: 0 12px 32px -14px rgba(124, 58, 237, 0.4);
}

.hope-ai-opt-ico {
  background: rgba(196, 181, 253, 0.35);
  color: #7c3aed;
  transition: background 0.2s ease, color 0.2s ease;
}

.hope-ai-opt:hover .hope-ai-opt-ico {
  background: rgba(167, 139, 250, 0.45);
  color: #6d28d9;
}

.hope-ai-opt--selected .hope-ai-opt-ico {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
}

.hope-ai-loading-icon {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35) 0%, rgba(251, 113, 133, 0.25) 100%);
  color: #7c3aed;
}

.hope-ai-summary {
  background: rgba(245, 243, 255, 0.95);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.hope-ai-summary-ico {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 55%, #fb7185 120%);
  color: #fff;
}

.hope-ai-course-card {
  border: 1px solid rgba(196, 181, 253, 0.4);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hope-ai-course-card:hover {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 16px 36px -18px rgba(124, 58, 237, 0.35);
  transform: translateY(-2px);
}

.hope-ai-course-rank {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.hope-ai-restart {
  border: 1px solid rgba(196, 181, 253, 0.5);
  color: #4c1d95;
  background: rgba(255, 255, 255, 0.9);
}

.hope-ai-restart:hover {
  background: rgba(245, 243, 255, 0.95);
  border-color: rgba(139, 92, 246, 0.45);
}

/* ===== Learning Path (new-arrivals) / About (articles) ===== */
.hope-journey-page,
.hope-about-page {
  position: relative;
  overflow: hidden;
}

.hope-journey-content,
.hope-about-content {
  position: relative;
  z-index: 1;
}

/* Hero card */
.hope-home-hero {
  width: 100%;
  max-width: 100%;
}

.hope-home-hero .hb-slider {
  border-radius: 0;
}

@media (min-width: 768px) {
  .hope-home-hero {
    margin-left: 0;
    margin-right: 0;
  }
}

.hope-journey-hero {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(251, 113, 133, 0.10) 0%, transparent 55%),
    radial-gradient(700px 380px at -5% 110%, rgba(139, 92, 246, 0.12) 0%, transparent 55%),
    rgba(255, 255, 255, 0.9);
}

/* Hero banner image (bd.png) */
.hope-journey-banner {
  border: none;
  background: transparent;
  box-shadow: 0 24px 60px -28px rgba(124, 58, 237, 0.28);
}

.hope-journey-banner-img {
  display: block;
  width: 100%;
  height: auto;
}

.hope-journey-banner-links {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0 6% 7%;
  pointer-events: none;
}

.hope-journey-banner-link {
  pointer-events: auto;
  border-radius: 9999px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hope-journey-banner-link:focus-visible {
  opacity: 0.35;
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

.hope-journey-banner-link--primary {
  width: min(38%, 220px);
  height: clamp(2.25rem, 5vw, 3rem);
}

.hope-journey-banner-link--secondary {
  width: min(30%, 180px);
  height: clamp(2.25rem, 5vw, 3rem);
}

@media (max-width: 639px) {
  .hope-journey-banner-links {
    padding: 0 5% 5%;
    gap: 0.35rem;
  }

  .hope-journey-banner-link--primary {
    width: min(46%, 180px);
    height: 2rem;
  }

  .hope-journey-banner-link--secondary {
    width: min(38%, 150px);
    height: 2rem;
  }
}

.hope-journey-mascot-glow {
  position: absolute;
  inset: 12%;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, rgba(251, 113, 133, 0.18) 45%, transparent 70%);
  filter: blur(8px);
}

.hope-journey-mascot {
  filter: drop-shadow(0 24px 40px rgba(124, 58, 237, 0.25));
  animation: hope-journey-float 5s ease-in-out infinite;
}

@keyframes hope-journey-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Step cards */
.hope-step {
  position: relative;
  border-radius: 1.5rem;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: rgba(255, 255, 255, 0.9);
  padding: 1.5rem 1.35rem;
  box-shadow: 0 18px 50px -30px rgba(124, 58, 237, 0.35);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hope-step:hover {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 26px 60px -28px rgba(124, 58, 237, 0.45);
}

.hope-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  border-radius: 1rem;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 14px 26px -12px rgba(124, 58, 237, 0.5);
  transition: transform 0.25s ease;
}

.hope-step:hover .hope-step-icon {
  transform: scale(1.08) rotate(-4deg);
}

.hope-step-num {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(124, 58, 237, 0.12);
  letter-spacing: -0.02em;
}

/* Connector line between steps (desktop) */
.hope-step-connector {
  display: none;
  position: absolute;
  top: 2.85rem;
  right: -0.65rem;
  width: 1.3rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.55), rgba(167, 139, 250, 0));
  z-index: 2;
}

.hope-step-connector::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.5rem;
  height: 0.5rem;
  border-top: 2px solid rgba(167, 139, 250, 0.55);
  border-right: 2px solid rgba(167, 139, 250, 0.55);
  rotate: 45deg;
}

@media (min-width: 1024px) {
  .hope-journey-grid > .hope-step:not(:last-child) .hope-step-connector {
    display: block;
  }
}

/* Step color themes */
.hope-step--coral  .hope-step-icon { background: radial-gradient(circle at 30% 25%, #fda4af, #fb7185 75%); }
.hope-step--purple .hope-step-icon { background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 75%); }
.hope-step--violet .hope-step-icon { background: radial-gradient(circle at 30% 25%, #d8b4fe, #a855f7 75%); }
.hope-step--gold   .hope-step-icon { background: radial-gradient(circle at 30% 25%, #fcd34d, #fb923c 75%); }

@media (prefers-reduced-motion: reduce) {
  .hope-journey-mascot { animation: none; }
}

/* ===== Catalog category panel + colored chip icons + mascot ===== */
.hope-cat-panel {
  background:
    radial-gradient(600px 280px at 100% -20%, rgba(167, 139, 250, 0.10) 0%, transparent 60%),
    rgba(255, 255, 255, 0.9);
}

.hope-chip--ico {
  padding-left: 0.45rem;
}

.hope-chip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.6rem;
  width: 1.6rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.72rem;
  box-shadow: 0 6px 14px -7px rgba(124, 58, 237, 0.55);
  transition: transform 0.2s ease;
}

.hope-chip--ico:hover .hope-chip-ico {
  transform: scale(1.1) rotate(-6deg);
}

.hope-chip-ico--all      { background: linear-gradient(135deg, #94a3b8, #64748b); }
.hope-chip-ico--coral    { background: radial-gradient(circle at 30% 25%, #fda4af, #fb7185 75%); }
.hope-chip-ico--business { background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 75%); }
.hope-chip-ico--tech     { background: radial-gradient(circle at 30% 25%, #93c5fd, #6366f1 75%); }
.hope-chip-ico--personal { background: radial-gradient(circle at 30% 25%, #d8b4fe, #a855f7 75%); }
.hope-chip-ico--health   { background: radial-gradient(circle at 30% 25%, #86efac, #34d399 75%); }
.hope-chip-ico--gold     { background: radial-gradient(circle at 30% 25%, #fcd34d, #fb923c 75%); }

.hope-chip-active .hope-chip-ico {
  background: rgba(255, 255, 255, 0.25) !important;
  box-shadow: none;
}

/* Category cards grid (catalog) */
.hope-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (min-width: 640px) { .hope-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hope-cat-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.hope-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem 0.6rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: rgba(255, 255, 255, 0.85);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.hope-cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 18px 40px -22px rgba(124, 58, 237, 0.5);
}
.hope-cat-card--active {
  border-color: transparent;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.14), rgba(251, 113, 133, 0.1));
  box-shadow: 0 16px 36px -20px rgba(124, 58, 237, 0.5);
}

.hope-cat-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
  width: 3.25rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 14px 26px -12px rgba(124, 58, 237, 0.5);
  transition: transform 0.22s ease;
}
.hope-cat-card:hover .hope-cat-circle { transform: scale(1.08) rotate(-5deg); }

.hope-cat-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2c2a4a;
  line-height: 1.2;
}
.hope-cat-card-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
}
.hope-cat-card--active .hope-cat-card-count { color: #7c3aed; }

.hope-cat-mascot-sm {
  width: 3.5rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(124, 58, 237, 0.3));
  animation: hope-cat-bob 3.2s ease-in-out infinite;
}

/* Mascot peeking in category panel */
.hope-cat-mascot-wrap {
  width: 9.5rem;
  position: relative;
}

.hope-cat-mascot {
  width: 8.5rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(124, 58, 237, 0.32));
  animation: hope-cat-bob 3.2s ease-in-out infinite;
}

@keyframes hope-cat-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-2deg); }
}

.hope-cat-bubble {
  position: relative;
  align-self: center;
  margin-bottom: -0.35rem;
  background: linear-gradient(95deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  padding: 0.5rem 0.85rem;
  border-radius: 0.9rem;
  box-shadow: 0 12px 26px -14px rgba(124, 58, 237, 0.6);
  z-index: 2;
}

.hope-cat-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.34rem;
  transform: translateX(-50%) rotate(45deg);
  width: 0.7rem;
  height: 0.7rem;
  background: #7c3aed;
  border-radius: 0.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .hope-cat-mascot { animation: none; }
}

/* ===== Course detail hero (Hope Space theme) ===== */
.hope-detail-hero {
  background:
    radial-gradient(680px 460px at 88% 118%, rgba(251, 146, 60, 0.42) 0%, transparent 60%),
    linear-gradient(120deg, #7c3aed 0%, #8b5cf6 40%, #c084fc 75%, #f0abfc 100%);
}

/* ใช้รูป bgc.png เป็นพื้นหลัง hero */
.hope-detail-hero--img {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.hope-detail-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(48px);
  opacity: 0.55;
}

.hope-detail-blob--coral {
  top: -4rem;
  right: -3rem;
  width: 20rem;
  height: 20rem;
  background: rgba(251, 113, 133, 0.5);
}

.hope-detail-blob--violet {
  bottom: -6rem;
  left: -4rem;
  width: 22rem;
  height: 22rem;
  background: rgba(167, 139, 250, 0.45);
}

.hope-detail-mascot {
  position: absolute;
  bottom: -1.25rem;
  left: 1rem;
  width: 10rem;
  height: auto;
  object-fit: contain;
  opacity: 0.88;
  filter: drop-shadow(0 18px 30px rgba(76, 29, 149, 0.45));
  animation: hope-journey-float 5.5s ease-in-out infinite;
}

@media (min-width: 1536px) {
  .hope-detail-mascot {
    width: 12rem;
    left: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hope-detail-mascot { animation: none; }
}

/* Footer background image */
.hope-footer {
  background-color: #7c3aed;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ===== Admin panel — Hope Space theme ===== */
.hope-admin-bg {
  background:
    radial-gradient(720px 520px at 88% -4%, rgba(251, 113, 133, 0.10) 0%, transparent 60%),
    radial-gradient(620px 480px at 8% 6%, rgba(167, 139, 250, 0.12) 0%, transparent 58%),
    linear-gradient(180deg, #faf9ff 0%, #f5f3ff 60%, #fafafa 100%);
}

/* ── Sidebar v2 — gradient + icons + accordion ── */
.hope-admin-sidebar {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 38%, #5b21b6 72%, #4c1d95 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 40px -12px rgba(76, 29, 149, 0.55);
  color: #fff;
}

.hope-admin-sidebar__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(220px 180px at 12% 8%, rgba(251, 113, 133, 0.22) 0%, transparent 70%),
    radial-gradient(260px 220px at 88% 92%, rgba(167, 139, 250, 0.18) 0%, transparent 72%);
  pointer-events: none;
}

.hope-admin-sidebar__logo {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.hope-admin-sidebar__logo-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #fb7185;
  border: 2px solid #6d28d9;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.35);
  animation: hope-admin-pulse 2.4s ease-in-out infinite;
}

@keyframes hope-admin-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

.hope-admin-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.hope-admin-nav-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

/* Sidebar v3 — flat nav + search + quick links */
.hope-admin-sidebar__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  flex-shrink: 0;
}

.hope-admin-sidebar__collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.hope-admin-sidebar__collapse:hover {
  background: rgba(255, 255, 255, 0.18);
}

.hope-admin-sidebar-expand {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 3.1rem;
  transform: translateY(-50%);
  border-radius: 0 12px 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: none;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  box-shadow: 4px 0 18px rgba(76, 29, 149, 0.35);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.hope-admin-sidebar-expand:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  transform: translateY(-50%) translateX(1px);
}

@media (min-width: 1024px) {
  body.admin-sidebar-collapsed #admin-sidebar {
    transform: translateX(-100%);
  }

  body.admin-sidebar-collapsed .hope-admin-main-shell {
    margin-left: 0 !important;
  }

  body.admin-sidebar-collapsed .hope-admin-sidebar-expand {
    display: inline-flex;
  }
}

.hope-admin-nav-search {
  position: relative;
  margin-bottom: 0.85rem;
}

.hope-admin-nav-search__icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.hope-admin-nav-search__input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.15rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hope-admin-nav-search__input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.hope-admin-nav-search__input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.hope-admin-nav-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.hope-admin-nav-quick__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  padding: 0.45rem 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.hope-admin-nav-quick__btn i {
  font-size: 0.95rem;
}

.hope-admin-nav-quick__btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.hope-admin-nav-quick__btn--active {
  background: #fff;
  color: #7c3aed;
  border-color: #fff;
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, 0.45);
}

.hope-admin-nav-section {
  margin-top: 0.85rem;
}

.hope-admin-nav-section:first-child {
  margin-top: 0;
}

.hope-admin-nav-section__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.hope-admin-nav-section__label i {
  font-size: 0.65rem;
  opacity: 0.85;
}

.hope-admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.15rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.hope-admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}

.hope-admin-nav-link--active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 0 #fb7185;
}

.hope-admin-nav-link--active .hope-admin-nav-icon,
.hope-admin-nav-link--active .hope-admin-nav-icon--sub {
  background: #fff;
  color: #7c3aed;
  box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.4);
}

.hope-admin-nav-icon--sub {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.72rem;
}

.hope-admin-nav-item,
.hope-admin-nav-group__toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.18s ease;
}

.hope-admin-nav-item:hover,
.hope-admin-nav-group__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}

.hope-admin-nav-item--active,
.hope-admin-nav-group.is-open > .hope-admin-nav-group__toggle {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.12);
}

.hope-admin-nav-item--active .hope-admin-nav-icon,
.hope-admin-nav-group.is-open > .hope-admin-nav-group__toggle .hope-admin-nav-icon {
  background: #fff;
  color: #7c3aed;
  box-shadow: 0 8px 18px -8px rgba(15, 23, 42, 0.35);
  transform: scale(1.04);
}

.hope-admin-nav-chevron {
  transition: transform 0.25s ease;
}

.hope-admin-nav-group.is-open .hope-admin-nav-chevron {
  transform: rotate(180deg);
}

.hope-admin-nav-group__panel {
  display: none;
  margin: 0.35rem 0 0.5rem 0.35rem;
  padding: 0.35rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px -18px rgba(15, 23, 42, 0.45);
  animation: hope-admin-panel-in 0.28s ease;
}

.hope-admin-nav-group.is-open .hope-admin-nav-group__panel {
  display: block;
}

@keyframes hope-admin-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hope-admin-nav-sub {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.hope-admin-nav-sub:hover {
  background: rgba(245, 243, 255, 0.95);
  color: #7c3aed;
  transform: translateX(2px);
}

.hope-admin-nav-sub--active {
  background: linear-gradient(95deg, rgba(139, 92, 246, 0.16), rgba(251, 113, 133, 0.1));
  color: #7c3aed;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.18);
}

.hope-admin-nav-sub__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.5rem;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.hope-admin-nav-sub--active .hope-admin-nav-sub__icon {
  background: #7c3aed;
  color: #fff;
}

.hope-admin-nav-badge {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #fb7185;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.25);
  flex-shrink: 0;
  animation: hope-admin-pulse 2.4s ease-in-out infinite;
}

.hope-admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.35rem;
}

.hope-admin-sidebar__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.45);
}

.hope-admin-sidebar__avatar-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #34d399;
  border: 2px solid #5b21b6;
}

.hope-admin-sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.hope-admin-sidebar__logout:hover {
  background: rgba(251, 113, 133, 0.22);
  color: #fff;
  transform: translateX(1px);
}

.hope-admin-sidebar__web:hover {
  transform: translateY(-1px);
}

.hope-admin-sidebar__nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.hope-admin-sidebar__nav::-webkit-scrollbar {
  width: 4px;
}

.hope-admin-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.hope-admin-topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.18);
}

/* legacy admin links (fallback) */
.hope-admin-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.hope-admin-link:hover {
  background: rgba(245, 243, 255, 0.9);
  color: #7c3aed;
}

.hope-admin-link--active {
  background: linear-gradient(95deg, rgba(139, 92, 246, 0.14), rgba(251, 113, 133, 0.1));
  color: #7c3aed;
}

.hope-admin-link--danger {
  color: #e11d48;
}
.hope-admin-link--danger:hover {
  background: rgba(254, 226, 226, 0.7);
  color: #e11d48;
}

@media (prefers-reduced-motion: reduce) {
  .hope-admin-sidebar__logo-dot,
  .hope-admin-nav-badge {
    animation: none;
  }

  .hope-admin-nav-sub:hover,
  .hope-admin-sidebar__logout:hover,
  .hope-admin-sidebar__web:hover {
    transform: none;
  }
}

@media (max-width: 1023px) {
  .hope-admin-sidebar {
    box-shadow: 16px 0 48px -12px rgba(76, 29, 149, 0.65);
  }
}

/* ── Admin EP manager (ebooks edit) ── */
.hope-admin-ep {
  border-top: 1px solid rgba(167, 139, 250, 0.35);
  padding-top: 2rem;
}

.hope-admin-ep__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hope-admin-ep__head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.hope-admin-ep__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
  font-size: 1.1rem;
  box-shadow: 0 10px 24px -14px rgba(124, 58, 237, 0.55);
}

.hope-admin-ep__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #2c2a4a;
  line-height: 1.3;
}

.hope-admin-ep__subtitle {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.hope-admin-ep__advanced {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.hope-admin-ep__advanced:hover {
  background: #f5f3ff;
  border-color: #8b5cf6;
  transform: translateY(-1px);
}

.hope-admin-ep__guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.hope-admin-ep__guide-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #fff;
}

.hope-admin-ep__guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hope-admin-ep__guide-step strong {
  display: block;
  font-size: 0.8125rem;
  color: #2c2a4a;
}

.hope-admin-ep__guide-step small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.4;
}

.hope-admin-ep__progress-wrap {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: #faf9ff;
}

.hope-admin-ep__progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.hope-admin-ep__progress-bar {
  height: 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.hope-admin-ep__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #34d399);
  transition: width 0.35s ease;
}

.hope-admin-ep__layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.hope-admin-ep__sidebar {
  border-radius: 1.15rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: #fff;
  overflow: hidden;
  position: sticky;
  top: 1rem;
}

.hope-admin-ep__sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(245, 243, 255, 0.7);
}

.hope-admin-ep__sidebar-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: #2c2a4a;
}

.hope-admin-ep__sidebar-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.hope-admin-ep__nav {
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
}

.hope-admin-ep__nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  text-decoration: none;
  transition: background 0.18s ease;
}

.hope-admin-ep__nav-item:hover {
  background: #faf9ff;
}

.hope-admin-ep__nav-item--active {
  background: linear-gradient(90deg, #f5f3ff, #fff);
  box-shadow: inset 3px 0 0 #8b5cf6;
}

.hope-admin-ep__nav-ep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hope-admin-ep__nav-body {
  min-width: 0;
  flex: 1;
}

.hope-admin-ep__nav-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #2c2a4a;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hope-admin-ep__nav-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  color: #64748b;
}

.hope-admin-ep__nav-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.hope-admin-ep__nav-dot--ok { background: #34d399; }
.hope-admin-ep__nav-dot--warn { background: #fbbf24; }

.hope-admin-ep__nav-free {
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

.hope-admin-ep__nav-arrow {
  font-size: 0.65rem;
  color: #cbd5e1;
  flex-shrink: 0;
}

.hope-admin-ep__nav-item--active .hope-admin-ep__nav-arrow {
  color: #8b5cf6;
}

.hope-admin-ep__sidebar-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.8125rem;
}

.hope-admin-ep__sidebar-empty i {
  display: block;
  font-size: 1.5rem;
  color: #c4b5fd;
  margin-bottom: 0.5rem;
}

.hope-admin-ep__add-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(167, 139, 250, 0.25);
  background: #faf9ff;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #7c3aed;
  text-decoration: none;
  transition: background 0.18s ease;
}

.hope-admin-ep__add-link:hover {
  background: #f5f3ff;
}

.hope-admin-ep__add-link--active {
  background: linear-gradient(90deg, #ede9fe, #f5f3ff);
  box-shadow: inset 0 3px 0 #8b5cf6;
}

.hope-admin-ep__editor {
  border-radius: 1.15rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
  box-shadow: 0 16px 40px -24px rgba(124, 58, 237, 0.3);
  overflow: hidden;
}

.hope-admin-ep__editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(245, 243, 255, 0.65);
}

.hope-admin-ep__editor-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.hope-admin-ep__editor-badge--add {
  background: #ecfdf5;
  color: #059669;
}

.hope-admin-ep__editor-badge--edit {
  background: #ede9fe;
  color: #7c3aed;
}

.hope-admin-ep__editor-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2c2a4a;
}

.hope-admin-ep__block {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.hope-admin-ep__block--last {
  border-bottom: 0;
}

.hope-admin-ep__block-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.hope-admin-ep__block-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
}

.hope-admin-ep__block-label {
  font-size: 0.875rem;
  font-weight: 800;
  color: #2c2a4a;
}

.hope-admin-ep__fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hope-admin-ep__details summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  list-style: none;
}

.hope-admin-ep__details summary::-webkit-details-marker {
  display: none;
}

.hope-admin-ep__duration-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.hope-admin-ep__duration-hint {
  font-size: 0.6875rem;
  color: #94a3b8;
}

.hope-admin-ep__video-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.hope-admin-ep__video-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hope-admin-ep__video-tab.is-active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #7c3aed;
}

.hope-admin-ep__video-panel {
  display: none;
}

.hope-admin-ep__video-panel.is-active {
  display: block;
}

.hope-admin-ep__hint--panel {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.hope-admin-ep__current-video--featured {
  margin-bottom: 0.85rem;
}

.hope-admin-ep__current-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.hope-admin-ep__remove-video {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e11d48;
  cursor: pointer;
}

.hope-admin-ep__replace-hint {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.hope-admin-ep__import-btn--sm {
  margin-top: 0.65rem;
  font-size: 0.6875rem;
  padding: 0.45rem 0.75rem;
  min-height: auto;
}

.hope-admin-ep__delete-form {
  display: inline;
}

.hope-admin-ep__delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(244, 63, 94, 0.3);
  background: #fff1f2;
  color: #e11d48;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background 0.18s ease;
}

.hope-admin-ep__delete-btn:hover {
  background: #ffe4e6;
}

.hope-admin-ep__main {
  border-radius: 1.15rem;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: #fff;
  overflow: hidden;
}

.hope-admin-ep__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(245, 243, 255, 0.55);
}

.hope-admin-ep__toolbar-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #475569;
}

.hope-admin-ep__submit--toolbar {
  min-height: 2.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.hope-admin-ep__cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
}

.hope-admin-ep__card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #faf9ff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.hope-admin-ep__card:hover {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 8px 24px -18px rgba(124, 58, 237, 0.35);
}

.hope-admin-ep__card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.45rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hope-admin-ep__card-body {
  min-width: 0;
  flex: 1;
}

.hope-admin-ep__card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #2c2a4a;
  line-height: 1.35;
}

.hope-admin-ep__card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.3rem;
  font-size: 0.6875rem;
  color: #64748b;
}

.hope-admin-ep__card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.hope-admin-ep__card-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  text-decoration: none;
  transition: background 0.18s ease;
}

.hope-admin-ep__card-edit:hover {
  background: #ede9fe;
}

.hope-admin-ep__card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(244, 63, 94, 0.25);
  background: #fff1f2;
  color: #e11d48;
  transition: background 0.18s ease;
}

.hope-admin-ep__card-delete:hover {
  background: #ffe4e6;
}

.hope-admin-ep__card-video {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: #ecfdf5;
  color: #059669;
  text-decoration: none;
  transition: background 0.18s ease;
}

.hope-admin-ep__card-video:hover {
  background: #d1fae5;
}

.hope-admin-ep__block--video {
  background: linear-gradient(180deg, #faf9ff 0%, #fff 100%);
}

.hope-admin-ep__video-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.hope-admin-ep__video-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.hope-admin-ep__video-status-item--ok {
  background: #ecfdf5;
  color: #059669;
}

.hope-admin-ep__video-status-item--warn {
  background: #fffbeb;
  color: #d97706;
}

.hope-admin-ep__upload-progress {
  margin-top: 0.65rem;
}

.hope-admin-ep__upload-progress-bar {
  height: 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.hope-admin-ep__upload-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #34d399);
  transition: width 0.2s ease;
}

.hope-admin-ep__upload-status {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
}

.hope-admin-ep__video-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(244, 63, 94, 0.25);
  background: #fff1f2;
  color: #e11d48;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.18s ease;
}

.hope-admin-ep__video-remove-btn:hover {
  background: #ffe4e6;
}

.hope-admin-ep__youtube-preview {
  margin-top: 0.75rem;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.hope-admin-ep__drop.is-highlight {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.hope-admin-ep__drop.is-uploading {
  pointer-events: none;
  opacity: 0.75;
}

.hope-admin-ep__import-btn--outline {
  background: #fff;
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: none;
}

.hope-admin-ep__import-btn--outline:hover {
  background: #f5f3ff;
}

/* EP Modal */
.hope-admin-ep-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.hope-admin-ep-modal.hidden {
  display: none;
}

.hope-admin-ep-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.hope-admin-ep-modal__wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: hope-ep-modal-in 0.28s ease-out;
}

@keyframes hope-ep-modal-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hope-admin-ep-modal__wrap { animation: none; }
}

.hope-admin-ep-modal__dialog {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fff;
  box-shadow: 0 -20px 60px -20px rgba(76, 29, 149, 0.45);
  overflow: hidden;
}

.hope-admin-ep-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
  background: linear-gradient(180deg, #f5f3ff, #fff);
  flex-shrink: 0;
}

.hope-admin-ep-modal__title {
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #2c2a4a;
  line-height: 1.3;
}

.hope-admin-ep-modal__subtitle {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}

.hope-admin-ep-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: #fff;
  color: #64748b;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.hope-admin-ep-modal__close:hover {
  background: #f5f3ff;
  color: #7c3aed;
}

.hope-admin-ep-modal__body {
  overflow-y: auto;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.hope-admin-ep-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem 1.15rem;
  border-top: 1px solid rgba(167, 139, 250, 0.2);
  background: #faf9ff;
  flex-shrink: 0;
}

.hope-admin-ep-modal__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
  margin-right: auto;
}

.hope-admin-ep-modal__cancel:hover {
  background: #f5f3ff;
  color: #7c3aed;
}

@media (min-width: 640px) {
  .hope-admin-ep-modal {
    align-items: center;
    padding: 1.25rem;
  }

  .hope-admin-ep-modal__dialog {
    border-radius: 1.25rem;
  }

  .hope-admin-ep-modal__wrap {
    max-height: 88vh;
  }
}

.hope-admin-ep__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hope-admin-ep__stat {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
}

.hope-admin-ep__stat--violet {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-color: rgba(139, 92, 246, 0.2);
}

.hope-admin-ep__stat--green {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: rgba(16, 185, 129, 0.2);
}

.hope-admin-ep__stat--amber {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: rgba(245, 158, 11, 0.22);
}

.hope-admin-ep__stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: #2c2a4a;
}

.hope-admin-ep__stat-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.hope-admin-ep__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.hope-admin-ep__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #fff;
  box-shadow: 0 8px 24px -18px rgba(124, 58, 237, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hope-admin-ep__item:hover {
  border-color: rgba(139, 92, 246, 0.45);
}

.hope-admin-ep__item--active {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.hope-admin-ep__item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hope-admin-ep__item-body {
  min-width: 0;
  flex: 1;
}

.hope-admin-ep__item-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #2c2a4a;
  line-height: 1.35;
}

.hope-admin-ep__item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.3rem;
  font-size: 0.6875rem;
  color: #64748b;
}

.hope-admin-ep__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.hope-admin-ep__tag--ok {
  background: #ecfdf5;
  color: #059669;
}

.hope-admin-ep__tag--warn {
  background: #fffbeb;
  color: #d97706;
}

.hope-admin-ep__tag--preview {
  background: #eff6ff;
  color: #2563eb;
}

.hope-admin-ep__item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.hope-admin-ep__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hope-admin-ep__btn--edit {
  border-color: rgba(139, 92, 246, 0.25);
  background: #f5f3ff;
  color: #7c3aed;
}

.hope-admin-ep__btn--edit:hover {
  background: #ede9fe;
}

.hope-admin-ep__btn--delete {
  border-color: rgba(244, 63, 94, 0.25);
  background: #fff1f2;
  color: #e11d48;
}

.hope-admin-ep__btn--delete:hover {
  background: #ffe4e6;
}

.hope-admin-ep__empty {
  margin-bottom: 1.25rem;
  padding: 2rem 1.25rem;
  text-align: center;
  border-radius: 1.25rem;
  border: 2px dashed rgba(167, 139, 250, 0.45);
  background: linear-gradient(180deg, #faf9ff, #f5f3ff);
}

.hope-admin-ep__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 1.25rem;
}

.hope-admin-ep__empty-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #2c2a4a;
}

.hope-admin-ep__empty-text {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.hope-admin-ep__import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(95deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 800;
  box-shadow: 0 12px 28px -14px rgba(124, 58, 237, 0.55);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.hope-admin-ep__import-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hope-admin-ep__form-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
  box-shadow: 0 16px 40px -24px rgba(124, 58, 237, 0.35);
  overflow: hidden;
}

.hope-admin-ep__form-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(245, 243, 255, 0.65);
}

.hope-admin-ep__form-step {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b5cf6;
}

.hope-admin-ep__form-title {
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 800;
  color: #2c2a4a;
}

.hope-admin-ep__form-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.hope-admin-ep__form-cancel:hover {
  color: #7c3aed;
}

.hope-admin-ep__form {
  padding: 0;
}

.hope-admin-ep__section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.hope-admin-ep__section--compact {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.hope-admin-ep__section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #5b21b6;
}

.hope-admin-ep__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.hope-admin-ep__hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.75rem;
  color: #64748b;
}

.hope-admin-ep__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.35rem 1rem;
  border-radius: 1rem;
  border: 2px dashed rgba(139, 92, 246, 0.35);
  background: #faf9ff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.hope-admin-ep__drop:hover,
.hope-admin-ep__drop.is-dragover {
  border-color: #8b5cf6;
  background: #f5f3ff;
  transform: translateY(-1px);
}

.hope-admin-ep__drop.has-file {
  border-color: #34d399;
  background: #ecfdf5;
}

.hope-admin-ep__drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 1rem;
}

.hope-admin-ep__drop-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2c2a4a;
}

.hope-admin-ep__drop-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.hope-admin-ep__drop-file {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #7c3aed;
}

.hope-admin-ep__current-video {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: #fff;
}

.hope-admin-ep__or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
}

.hope-admin-ep__or::before,
.hope-admin-ep__or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(203, 213, 225, 0.9);
}

.hope-admin-ep__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.hope-admin-ep__toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hope-admin-ep__toggle-ui {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.hope-admin-ep__toggle-ui::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  transition: transform 0.2s ease;
}

.hope-admin-ep__toggle-input:checked + .hope-admin-ep__toggle-ui {
  background: linear-gradient(95deg, #8b5cf6, #7c3aed);
}

.hope-admin-ep__toggle-input:checked + .hope-admin-ep__toggle-ui::after {
  transform: translateX(1.2rem);
}

.hope-admin-ep__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hope-admin-ep__toggle-text strong {
  font-size: 0.875rem;
  color: #2c2a4a;
}

.hope-admin-ep__toggle-text small {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
}

.hope-admin-ep__form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(167, 139, 250, 0.15);
  background: rgba(250, 249, 255, 0.5);
}

.hope-admin-ep__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.35rem;
  border-radius: 0.85rem;
  background: linear-gradient(95deg, #8b5cf6 0%, #7c3aed 45%, #fb7185 130%);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  box-shadow: 0 14px 30px -14px rgba(124, 58, 237, 0.55);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.hope-admin-ep__submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

@media (max-width: 900px) {
  .hope-admin-ep__layout {
    grid-template-columns: 1fr;
  }

  .hope-admin-ep__sidebar {
    position: static;
  }

  .hope-admin-ep__guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .hope-admin-ep__stats {
    grid-template-columns: 1fr;
  }

  .hope-admin-ep__item {
    flex-wrap: wrap;
  }

  .hope-admin-ep__item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .hope-admin-ep__card {
    flex-wrap: wrap;
  }

  .hope-admin-ep__card-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .hope-admin-ep-modal__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .hope-admin-ep-modal__cancel {
    margin-right: 0;
    order: 2;
  }

  .hope-admin-ep-modal__foot .hope-admin-ep__submit {
    order: 1;
    width: 100%;
  }

  .hope-admin-ep-modal__foot .hope-admin-ep__delete-form {
    order: 3;
    width: 100%;
  }

  .hope-admin-ep-modal__foot .hope-admin-ep__delete-btn {
    width: 100%;
  }
}

/* ===== Wishlist / Cart pages — Hope Space theme ===== */
.hope-fav-page,
.hope-cart-page {
  position: relative;
  overflow: hidden;
}

.hope-fav-content,
.hope-cart-content {
  position: relative;
  z-index: 1;
}

/* ===== Auth modal (login/register) — Hope Space theme ===== */
.hope-auth-panel {
  background:
    radial-gradient(520px 360px at 100% 0%, rgba(251, 113, 133, 0.12) 0%, transparent 58%),
    radial-gradient(520px 380px at 0% 100%, rgba(139, 92, 246, 0.16) 0%, transparent 60%),
    linear-gradient(160deg, #f5f3ff 0%, #ffffff 70%);
}

.hope-auth-mascot {
  width: 7.5rem;
  height: auto;
  object-fit: contain;
  margin-top: 0.5rem;
  margin-left: auto;
  filter: drop-shadow(0 16px 26px rgba(124, 58, 237, 0.3));
  animation: hope-journey-float 5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hope-auth-mascot { animation: none; }
}

/* ไอคอนหัวข้อ section สีสัน — วงกลม gradient */
.hope-sec-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 12px 24px -12px rgba(124, 58, 237, 0.5);
  flex-shrink: 0;
}

.hope-sec-ico--purple { background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 75%); }
.hope-sec-ico--coral  { background: radial-gradient(circle at 30% 25%, #fda4af, #fb7185 75%); }
.hope-sec-ico--tech   { background: radial-gradient(circle at 30% 25%, #93c5fd, #6366f1 75%); }
.hope-sec-ico--health { background: radial-gradient(circle at 30% 25%, #86efac, #34d399 75%); }
.hope-sec-ico--gold   { background: radial-gradient(circle at 30% 25%, #fcd34d, #fb923c 75%); }

/* ── Certificate overlay (cer.png) ── */
.hope-cert-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1492 / 1054;
  container-type: inline-size;
  container-name: hope-cert;
}

.hope-cert-frame__bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.hope-cert-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hope-cert-slot--name,
.hope-cert-slot--course,
.hope-cert-slot--date {
  overflow: hidden;
}

/* ช่องว่างเหนือเส้นทอง — ชื่อผู้รับ (ตรงกับ PDF export ~44.3%) */
.hope-cert-slot--name {
  position: absolute;
  left: 22.5%;
  right: 22.5%;
  top: 40.5%;
  height: 7.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hope-cert-name {
  width: 100%;
  font-weight: 800;
  color: #6d28d9;
  font-size: clamp(11px, 4.1cqi, 30px);
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ชื่อคอร์ส (~57.1%) — เฟดบังข้อความคงที่ในเทมเพลต */
.hope-cert-slot--course {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 52%;
  height: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hope-cert-slot--course::before {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  top: -8%;
  bottom: -8%;
  background: radial-gradient(ellipse 68% 62% at 50% 50%, #ffffff 0%, #ffffff 62%, rgba(255,255,255,0) 100%);
  z-index: 0;
}

.hope-cert-course {
  position: relative;
  z-index: 1;
  width: 100%;
  font-weight: 700;
  color: #7c3aed;
  font-size: clamp(8px, 2.5cqi, 16px);
  line-height: 1.2;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* วันที่ (~69.2%) */
.hope-cert-slot--date {
  position: absolute;
  left: 22.5%;
  right: 22.5%;
  top: 66%;
  height: 6.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hope-cert-date {
  width: 100%;
  font-size: clamp(7px, 1.8cqi, 13px);
  line-height: 1.15;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hope-cert-slot--no {
  position: absolute;
  left: 6%;
  bottom: 8%;
}

.hope-cert-no {
  font-size: clamp(7px, 1.6cqi, 12px);
  font-weight: 600;
  color: #fff;
}

/* =====================================================================
   HOPE SPACE — Mobile / Tablet Responsive (all devices)
   ===================================================================== */

/* ป้องกัน horizontal scroll จาก child กว้างเกิน */
.vio-theme,
.vio-theme > .relative.z-10 {
  min-width: 0;
  width: 100%;
}

/* Header — ไม่ให้ล้นบนจอเล็ก */
.hope-nav nav {
  min-width: 0;
  gap: 0.5rem;
}

@media (max-width: 639px) {
  .hope-nav nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hope-nav .hope-btn-nav {
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.35rem;
  }

  .hope-nav .hope-btn-nav span:not(.sr-only) {
    display: none;
  }

  .hope-nav-link-mobile-hide {
    display: none !important;
  }
}

/* Auth modal — mobile bottom sheet */
@media (max-width: 767px) {
  .hope-auth-modal-wrap {
    align-items: flex-end;
    padding: 0;
  }

  .hope-auth-modal-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 94vh);
    border-radius: 1.25rem 1.25rem 0 0;
    border-bottom: 0;
    overflow: hidden;
  }

  .hope-auth-sheet-handle {
    flex-shrink: 0;
    width: 2.75rem;
    height: 0.28rem;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: #c4b5fd;
  }

  .hope-auth-modal-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .hope-auth-form-panel {
    padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .hope-auth-form-head {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -0.85rem -1rem 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(245, 243, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(196, 181, 253, 0.45);
  }

  .hope-auth-mobile-banner {
    margin-top: 0.15rem;
  }

  .hope-auth-social-btn,
  .hope-auth-tabs .auth-tab,
  .hope-auth-input,
  .hope-auth-submit {
    min-height: 44px;
  }

  .hope-auth-submit {
    min-height: 48px;
  }

  /* ลดระยะห่างฟอร์มบนมือถือ */
  .hope-auth-form-panel .auth-panel {
    gap: 0.85rem;
  }

  .hope-auth-form-panel .auth-panel.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.85rem;
  }
}

@media (min-width: 768px) {
  .hope-auth-sheet-handle {
    display: none;
  }

  .hope-auth-modal-dialog {
    max-height: min(90vh, 52rem);
    overflow: hidden;
  }

  .hope-auth-modal-grid {
    max-height: min(90vh, 52rem);
    overflow-y: auto;
  }
}

/* Bottom nav + safe area (iPhone) */
@media (max-width: 767px) {
  .hope-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .hope-sticky-ai {
    right: 0.65rem;
    bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }

  .hope-sticky-ai-stack {
    padding-top: 4.25rem;
  }

  .hope-sticky-ai-mascot {
    width: 4.25rem;
    right: 0.35rem;
  }

  .hope-sticky-ai-btn {
    padding: 0.6rem 0.85rem;
    font-size: 0.72rem;
    max-width: calc(100vw - 1.5rem);
  }

  .hope-sticky-ai-btn span {
    white-space: nowrap;
  }
}

/* แถวการ์ดคอร์ส — scroll บนมือถือ */
.hope-course-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 0.75rem;
}

@media (max-width: 1023px) {
  .hope-course-scroll > * {
    scroll-snap-align: start;
  }
}

/* คอร์สมาใหม่ — วิดีโอเต็มกรอบการ์ด */
.home-course-card__media {
  background: #0f172a;
}

.home-course-card__media--video {
  min-height: 11rem;
}

.home-course-card__media--video video,
.home-course-card__media--video img {
  transform: scale(1.01);
}

.hope-new-arrivals-scroll .home-course-card__media--video {
  aspect-ratio: 16 / 9;
}

@media (min-width: 1024px) {
  .hope-new-arrivals-scroll .home-course-card__media--video {
    min-height: 10.5rem;
  }
}

/* Detail — EP เรียนแล้ว */
.detail-curriculum-lesson--done {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.06), transparent 55%);
}

.detail-curriculum-lesson--done .text-slate-700 {
  color: #334155;
}

/* ตาราง/ข้อมูลกว้าง — scroll แนวนอนได้ */
.hope-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
}

.hope-table-wrap table {
  min-width: 640px;
}

/* Course detail hero */
@media (max-width: 639px) {
  .hope-detail-hero .hope-detail-video-wrap {
    width: 100% !important;
  }

  .hope-detail-hero h1 {
    font-size: 1.125rem;
    line-height: 1.45;
  }

  .hope-detail-hero .start-learning-btn,
  .hope-detail-hero a.flex-1 {
    min-width: 0 !important;
    width: 100%;
  }

  .hope-detail-hero .inline-flex.items-center.gap-2.self-start {
    max-width: 100%;
    font-size: 0.65rem;
    padding: 0.45rem 0.65rem;
  }
}

/* Learn page — progress bar บนมือถือ */
.hope-learn-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hope-learn-sidebar {
  display: flex;
  flex-direction: column;
}

.hope-learn-sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hope-learn-sidebar__summary {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: #f5f3ff;
  padding: 0.35rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #7c3aed;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.12);
}

.hope-learn-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.hope-learn-sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  background: #faf5ff;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.hope-learn-sidebar__item:hover {
  background: #f3e8ff;
  border-color: rgba(124, 58, 237, 0.15);
}

.hope-learn-sidebar__item--active {
  background: #fff;
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 8px 24px -16px rgba(124, 58, 237, 0.45);
}

.hope-learn-sidebar__item--done {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), #faf5ff 65%);
  border-color: rgba(16, 185, 129, 0.18);
}

.hope-learn-sidebar__item--done.hope-learn-sidebar__item--active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), #fff 60%);
  border-color: rgba(16, 185, 129, 0.35);
}

.hope-learn-sidebar__ep-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 0.5rem;
  background: #ede9fe;
  font-size: 0.625rem;
  font-weight: 800;
  color: #6d28d9;
}

.hope-learn-sidebar__item--done .hope-learn-sidebar__ep-num {
  background: #d1fae5;
  color: #047857;
}

.hope-learn-sidebar__ep-body {
  flex: 1;
  min-width: 0;
}

.hope-learn-sidebar__ep-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #2c2a4a;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hope-learn-sidebar__ep-status {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #94a3b8;
}

.hope-learn-sidebar__item--done .hope-learn-sidebar__ep-status {
  color: #059669;
}

.hope-learn-sidebar__item--active:not(.hope-learn-sidebar__item--done) .hope-learn-sidebar__ep-status {
  color: #7c3aed;
}

.hope-learn-sidebar__ep-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
}

.hope-learn-sidebar__cert {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.hope-learn-sidebar__cert-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  font-size: 1.1rem;
}

.hope-learn-sidebar__cert-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.hope-learn-sidebar__cert-text strong {
  font-size: 0.8125rem;
  line-height: 1.3;
}

.hope-learn-sidebar__cert-text small {
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.3;
}

.hope-learn-sidebar__cert--inactive {
  cursor: not-allowed;
  opacity: 0.72;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.hope-learn-sidebar__cert--inactive .hope-learn-sidebar__cert-icon {
  background: #e2e8f0;
  color: #94a3b8;
}

.hope-learn-sidebar__cert--active {
  cursor: pointer;
  opacity: 1;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(52, 211, 153, 0.08));
  border-color: #10b981;
  color: #065f46;
}

.hope-learn-sidebar__cert--active .hope-learn-sidebar__cert-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.65);
}

.hope-learn-sidebar__cert--active:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(16, 185, 129, 0.45);
}

@media (min-width: 1024px) {
  .hope-learn-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hope-learn-sidebar {
    width: 17.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 4.75rem;
    max-height: calc(100vh - 5.5rem);
  }

  .hope-learn-main {
    flex: 1;
  }
}

@media (max-width: 639px) {
  .hope-learn-topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hope-learn-topbar .truncate.max-w-\[40vw\] {
    max-width: 55vw;
  }
}

/* Member — sidebar tabs */
@media (max-width: 767px) {
  .hope-member-sidebar {
    position: static;
  }

  .hope-member-mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 25;
    margin-inline: -0.25rem;
    border-radius: 1rem;
  }

  .hope-member-mobile-tabs-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 0.5rem;
  }

  .hope-member-mobile-tab.hope-member-mobile-tab--active,
  .hope-member-mobile-tab.bg-violet-100 {
    box-shadow: 0 4px 14px -6px rgba(124, 58, 237, 0.35);
  }
}

/* Member — certificates tab (mobile-first) */
@media (max-width: 767px) {
  .hope-member-certs-head {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .hope-member-certs-list {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .hope-member-cert-card {
    border-radius: 1.25rem;
  }

  .hope-member-cert-thumb .hope-cert-name {
    font-size: clamp(9px, 5.5cqi, 15px);
  }
}

@media (min-width: 768px) {
  .hope-member-certs-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
  }

  .hope-member-cert-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
  }

  .hope-member-cert-card > a {
    flex-shrink: 0;
  }

  .hope-member-cert-card > div:last-child {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hope-member-cert-card h3 {
    min-height: 2.75rem;
  }

  .hope-member-cert-cta {
    margin-top: auto;
  }
}

/* Thumbnail — แสดงเฉพาะชื่อ (ชื่อคอร์สอยู่ใต้การ์ดแล้ว) */
.hope-member-cert-thumb .hope-cert-slot--course {
  display: none;
}

.hope-member-cert-thumb .hope-cert-slot--name {
  top: 42%;
  height: 12%;
}

@media (min-width: 1280px) {
  .hope-member-certs-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Member sidebar — icon chips + hover */
.hope-member-nav {
  position: relative;
}

.hope-member-nav__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(180px 140px at 100% 0%, rgba(167, 139, 250, 0.14) 0%, transparent 70%),
    radial-gradient(160px 120px at 0% 100%, rgba(251, 113, 133, 0.1) 0%, transparent 72%);
}

.hope-member-nav__section {
  padding: 0.35rem 0.5rem 0.55rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b5cf6;
}

.hope-member-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.hope-member-nav-item:hover {
  background: rgba(245, 243, 255, 0.9);
  color: #6d28d9;
  transform: translateX(3px);
}

.hope-member-nav-item--active {
  background: linear-gradient(95deg, rgba(139, 92, 246, 0.14), rgba(251, 113, 133, 0.08));
  border-color: rgba(139, 92, 246, 0.22);
  color: #5b21b6;
  box-shadow: 0 8px 22px -16px rgba(124, 58, 237, 0.45);
}

.hope-member-nav-item--danger {
  color: #e11d48;
}

.hope-member-nav-item--danger:hover {
  background: rgba(254, 226, 226, 0.65);
  color: #be123c;
}

.hope-member-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  color: #fff;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hope-member-nav-item:hover .hope-member-nav-icon,
.hope-member-nav-item--active .hope-member-nav-icon {
  transform: scale(1.06);
  box-shadow: 0 8px 18px -10px rgba(124, 58, 237, 0.45);
}

.hope-member-nav-icon--violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.hope-member-nav-icon--indigo { background: linear-gradient(135deg, #818cf8, #6366f1); }
.hope-member-nav-icon--sky { background: linear-gradient(135deg, #7dd3fc, #0ea5e9); }
.hope-member-nav-icon--purple { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.hope-member-nav-icon--amber { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.hope-member-nav-icon--rose { background: linear-gradient(135deg, #fda4af, #fb7185); }
.hope-member-nav-icon--danger { background: linear-gradient(135deg, #fca5a5, #ef4444); }

@media (prefers-reduced-motion: reduce) {
  .hope-member-nav-item:hover {
    transform: none;
  }
}

/* Modal ทั่วไป — ไม่ล้นจอ */
@media (max-width: 639px) {
  [role="dialog"].max-w-3xl,
  [role="dialog"].max-w-5xl,
  [role="dialog"].max-w-6xl {
    max-height: 92vh;
  }

  .hope-ai-modal-panel {
    max-height: 94vh;
  }
}

/* ปุ่ม/ลิงก์ — touch target ขั้นต่ำ ~44px */
@media (max-width: 767px) {
  .hope-bottom-item,
  .hope-bottom-home-btn,
  .hope-btn-primary,
  .hope-btn-nav {
    min-height: 44px;
  }
}

@media (min-width: 768px) {
  .hope-sticky-ai {
    bottom: 1.5rem;
  }
}

/* หน้าหลัก — padding บนจอเล็กมาก */
@media (max-width: 374px) {
  .max-w-8xl.mx-auto.px-4,
  .max-w-8xl.mx-auto.px-4.md\:px-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Footer — ไม่ให้ข้อความล้น */
@media (max-width: 639px) {
  .hope-footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .hope-footer .grid {
    gap: 1.5rem;
  }
}

/* Wishlist / catalog cards บนมือถือเล็ก */
@media (max-width: 374px) {
  .hope-wishlist-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin — ตาราง scroll บนมือถือ */
@media (max-width: 767px) {
  .admin-theme-light .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    margin-inline: -0.5rem;
    padding-inline: 0.5rem;
  }

  .hope-admin-topbar h1 {
    font-size: 1rem;
  }
}

/* Homepage category auto-slider */
.hope-cat-slider {
  position: relative;
  width: 100%;
}

.hope-cat-slider__viewport {
  overflow: hidden;
  width: 100%;
}

.hope-cat-slider__track {
  width: max-content;
  will-change: transform;
}

.hope-cat-slider__card {
  width: 7.75rem;
  min-width: 7.75rem;
}

@media (min-width: 640px) {
  .hope-cat-slider__card {
    width: 8.5rem;
    min-width: 8.5rem;
  }
}

@media (min-width: 768px) {
  .hope-cat-slider__card {
    width: 9.375rem;
    min-width: 9.375rem;
  }
}

.hope-cat-slider__fade {
  display: block;
}

.hope-home-cat-card {
  border-radius: 1.15rem;
  box-shadow: 0 14px 34px -24px rgba(124, 58, 237, 0.35);
}

/* =====================================================================
   Homepage — Mobile UX
   ===================================================================== */
.hope-home-scroll-wrap {
  position: relative;
}

.hope-home-scroll-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0.5rem;
  width: 2.75rem;
  pointer-events: none;
  background: linear-gradient(to left, rgba(248, 250, 252, 0.98) 0%, rgba(248, 250, 252, 0.55) 45%, transparent 100%);
  z-index: 5;
}

.hope-home-scroll-hint {
  letter-spacing: 0.01em;
}

@media (max-width: 767px) {
  .hope-page--home .hope-main-content {
    padding-bottom: 0.5rem;
  }

  .hope-home-hero {
    margin-bottom: 0;
  }

  .hope-home-hero + .hope-home-section {
    padding-top: 1rem;
  }

  .hope-home-section .gold-divider {
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
  }

  .hope-home-section-head h2 {
    line-height: 1.25;
  }

  .hope-home-section-link {
    min-height: 2.25rem;
    padding-inline: 0.35rem;
    align-items: center;
  }

  .hope-home-cat-scroll {
    margin-inline: -0.15rem;
    padding-inline: 0.15rem;
    scroll-padding-inline: 0.75rem;
  }

  .hope-cat-slider__card {
    width: 7.1rem;
    min-width: 7.1rem;
    padding: 0.65rem;
  }

  .hope-home-cat-card span.text-sm {
    font-size: 0.8125rem;
  }

  .hope-course-scroll {
    scroll-padding-inline: 0.65rem;
    padding-bottom: 0.35rem;
  }

  .hope-course-scroll > [data-course-pop] {
    scroll-snap-stop: always;
  }

  .hope-home .home-course-card {
    border-radius: 1.15rem;
  }

  .hope-home .home-course-card .absolute.-bottom-5.left-4 img {
    height: 2.75rem;
    width: 2.75rem;
    border-width: 2.5px;
  }

  .hope-home .home-course-card .absolute.-bottom-5 {
    bottom: -1.1rem;
  }

  .hope-home .home-course-card h3 {
    font-size: 0.9375rem;
  }

  .hope-home .home-course-card .rounded-lg.border.border-violet-200\/70 {
    padding: 0.45rem 0.55rem;
  }

  .hope-home .home-course-card .rounded-lg.border.border-violet-200\/70 .text-\[10px\] {
    font-size: 0.625rem;
  }

  .hope-home-all-grid {
    gap: 0.85rem;
  }

  .hope-home-testimonial .hope-testimonial {
    border-radius: 1.25rem;
  }

  .hope-nav-tagline {
    display: none;
  }

  .hope-nav-brand {
    max-width: calc(100vw - 9.5rem);
  }

  .hope-sticky-ai-btn {
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .hope-sticky-ai-btn-text {
    display: none;
  }

  .hope-sticky-ai-btn-icon {
    font-size: 1.125rem;
  }

  .hope-sticky-ai-stack {
    padding-top: 3.5rem;
  }

  .hope-sticky-ai-mascot {
    width: 3.5rem;
  }

  .hope-bottom-nav .hope-bottom-label,
  .hope-bottom-home-label {
    font-size: 0.58rem;
  }

  .hope-bottom-icon {
    height: 2.5rem;
    width: 2.5rem;
    font-size: 1rem;
  }

  .hope-bottom-home-btn {
    height: 3.15rem;
    width: 3.15rem;
    font-size: 1.1rem;
  }
}

@media (max-width: 374px) {
  .hope-cat-slider__card {
    width: 7.1rem;
    min-width: 7.1rem;
    padding: 0.65rem;
  }

  .hope-course-scroll > [data-course-pop] {
    width: min(100%, 84vw) !important;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  .hope-sticky-ai-btn {
    width: auto;
    height: auto;
    padding: 0.6rem 0.85rem;
    gap: 0.45rem;
  }

  .hope-sticky-ai-btn-text {
    display: inline;
    font-size: 0.72rem;
  }
}
