/* ==========================================================================
   STORETESTS — UNIFIED DESIGN SYSTEM (SPA ↔ MPA shop)
   One visual language for the whole site: navy structural shell, orange
   action colour, cool paper canvas, cool hairline borders, one radius scale.
   Purely token overrides scoped to the app shell; no logic, no template or
   contract changes.

   Reference language measured from the target design: navy #1A3A5C structure,
   orange #E07B39 action, teal #0D9488 secondary, paper #F7F9FB canvas,
   hairline #DCE5EE borders, pill + 24px radius scale.
   ========================================================================== */

/* 1) Brand tokens — navy structure / orange action / teal secondary */
:root,
body {
  --primary: #1A3A5C !important;
  --primary-light: #3B6B99 !important;
  --primary-dark: #132D48 !important;
  --primary-glow: rgba(26, 58, 92, 0.15) !important;
  --accent: #E07B39 !important;
  --accent-light: #F0A26A !important;
  --accent-dark: #A14E14 !important;
  --accent-glow: rgba(224, 123, 57, 0.15) !important;
  --accent-2: #0D9488 !important;
  --accent-pos: #2F855A !important;
  --shadow-primary: 0 8px 24px rgba(26, 58, 92, 0.22) !important;
}

/* 1b) Default state (no theme class yet) must read as LIGHT.
   The dark palette is opt-in via .dark-theme. Without this block the body
   inherited the :root dark palette for text while the canvas came from the
   light rule - washed-out headings and dark cards on a light background.
   Values mirror .light-theme exactly, so "no class" and "light" look the same. */
body:not(.dark-theme) {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #020617;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --success: #059669;
  --success-glow: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --warning-glow: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-glow: rgba(220, 38, 38, 0.08);
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-reflection: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 16px -6px rgba(15, 23, 42, 0.03);
  --shadow-primary: 0 4px 20px rgba(30, 58, 88, 0.15);
  --bg-card: #ffffff;
  --border-card: rgba(15, 23, 42, 0.12);
  --bg-header: rgba(248, 250, 252, 0.9);
  --bg-page: #f8fafc;
  --input-bg: #ffffff;
  --sidebar-text: #1e293b;
}

/* 2) Ambient background — cool paper with a faint dot grid */
body.light-theme,
body:not(.dark-theme) {
  background-color: #F7F9FB !important;
  background-image: radial-gradient(rgb(223, 232, 241) 1.4px, rgba(0, 0, 0, 0) 1.4px) !important;
  background-size: 24px 24px !important;
}

/* 3) App header — navy shell, orange action accents */
header {
  background: linear-gradient(135deg, #1A3A5C 0%, #16304E 55%, #10273C 100%) !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
}
header .nav-link { color: rgba(255, 255, 255, 0.78); }
header .nav-link.active,
header .nav-link:hover { color: #fff !important; background: rgba(255, 255, 255, 0.14) !important; border-radius: 10px; }
header .nav-link.active::after { background: #F0A26A !important; }
.logo-icon {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
}
.logo-text { color: #fff !important; -webkit-text-fill-color: #fff !important; }

/* Coin + account chips on the navy header need readable contrast */
header .coin-balance-pill {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

/* 4) Buttons — orange action, tight 10px shape */
body .btn-primary {
  background-color: var(--accent) !important;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(224, 123, 57, 0.30) !important;
  border-radius: 10px !important;
}
body .btn-primary:hover {
  background-color: var(--accent) !important;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.06)) !important;
  box-shadow: 0 10px 26px rgba(224, 123, 57, 0.38) !important;
  transform: translateY(-1px);
}
body .btn-accent {
  background: #0D9488 !important;
  color: #fff !important;
  border-color: #0F766E !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.22) !important;
}
body .btn-accent:hover, body .btn-accent.btn-hero:hover {
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.3) !important;
}
body .btn-secondary {
  border-radius: 10px !important;
}
body .btn-secondary:hover { border-color: var(--accent) !important; color: var(--accent) !important; }

/* 5) Cards — cool hairline border, 24px radius */
body main.app-container .glass-card.glass-card {
  background: #FFFFFF !important;
  border: 1px solid #DCE5EE !important;
  border-radius: 24px !important;
  box-shadow: 0 12px 30px rgba(26, 58, 92, 0.10) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.dark-theme main.app-container .glass-card.glass-card {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.20) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
}
.landing-features-title,
#view-dashboard .shop-main-title,
#view-bookstore .shop-main-title {
  background: linear-gradient(135deg, #1A3A5C 0%, #3B6B99 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 6) Quiz cards — shop-like purchase rows */
body main.app-container .quizzes-grid .quiz-product-card,
body main.app-container .quizzes-grid .quiz-card {
  background: #FFFFFF !important;
  border: 1px solid #DCE5EE !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 26px rgba(26, 58, 92, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.quiz-product-card:hover,
.quiz-card:hover,
body main.app-container .quizzes-grid .quiz-product-card:hover,
body main.app-container .quizzes-grid .quiz-card:hover {
  border-color: #F0A26A !important;
  box-shadow: 0 16px 36px rgba(224, 123, 57, 0.22) !important;
  transform: translateY(-3px);
}

/* 7) Arena — exam room in the shop language (no mascot, focused UI) */
#view-arena .arena-title-bar,
#view-arena .arena-palette-card,
#view-arena .question-card,
body main.app-container #view-arena .question-card {
  background: #FFFFFF !important;
  border: 1px solid #DCE5EE !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 30px rgba(26, 58, 92, 0.10) !important;
  backdrop-filter: none !important;
}
#view-arena .arena-title-bar {
  border-left: 4px solid #E07B39 !important;
}
#view-arena #arena-progress-indicator {
  background: #F1F6FB !important;
  color: #1A3A5C !important;
  border: 1.5px solid #C7D8E8 !important;
}
#view-arena #arena-timer {
  color: #E07B39 !important;
}
#view-arena .palette-item.answered {
  background: #E07B39;
  color: #fff;
}
#view-arena .palette-item.current,
#view-arena .palette-item.current.answered {
  background: #F6C453;
  color: #3A2510;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.45);
}
#view-arena .palette-item.flagged {
  background: #0D9488;
  color: #fff;
}

/* 8) Results — score card */
.results-header-card .score-number {
  background: linear-gradient(135deg, #E07B39, #F6C453);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-stat-box {
  border-radius: 16px;
  border: 1px solid #DCE5EE;
}

/* 9) Leaderboard — stepped tone for placement */
#view-leaderboard .leaderboard-scope-btn.active {
  background: linear-gradient(135deg, #F0A26A, #E07B39);
  border: none;
  color: #fff;
}

/* 10) Bookstore / dashboard section titles — same treatment */
.shop-breadcrumbs { color: var(--accent-2); }

/* 11) Modals & checkout — cool card */
.modal-box {
  border-radius: 22px;
}
#modal-checkout-qr .modal-box,
#modal-book-detail .modal-box {
  border: 1px solid #DCE5EE !important;
  box-shadow: 0 28px 60px rgba(26, 58, 92, 0.25), 0 0 0 4px #F1F6FB !important;
  background: #FFFFFF !important;
}
#modal-checkout-qr h3,
#modal-checkout-qr h4 {
  color: #1A3A5C !important;
}

/* 13) Hero title accent — warm orange-gold word */
body .hero-title span {
  background: linear-gradient(135deg, #F6C453 0%, #E07B39 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Arena navigation controls */
body.arena-active #view-arena .arena-nav-btns #arena-next-btn,
#view-arena #arena-next-btn {
  background: linear-gradient(135deg, #F0A26A 0%, #E07B39 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 18px rgba(224, 123, 57, 0.32) !important;
}
body.arena-active #view-arena #arena-palette-toggle,
#view-arena .arena-palette-toggle {
  background: #F1F6FB !important;
  color: #1A3A5C !important;
  border-color: #C7D8E8 !important;
}
#view-arena .palette-toggle-count {
  background: #DCE5EE !important;
  color: #1A3A5C !important;
  border-radius: 999px !important;
}

/* Mark-for-review (warning) */
body.arena-active #arena-flag-toggle,
#view-arena #arena-flag-toggle {
  background: #FEF6E7 !important;
  color: #A14E14 !important;
  border-color: #F3D9A8 !important;
  box-shadow: none !important;
}

/* Leaderboard title — navy instead of inherited gradient */
#view-leaderboard h1 {
  background: linear-gradient(135deg, #1A3A5C 0%, #3B6B99 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* 12) Subscription — plan cards alt palette */
#view-subscription .plan-card:hover {
  border-color: #F0A26A;
  box-shadow: 0 18px 40px rgba(224, 123, 57, 0.25);
}
.feat-4, .feat-5, .feat-6 { color: #fff; }

/* 14) No leftover legacy palette: badges, focus, tabs, links */
#view-arena .q-number-badge,
.question-card .q-number-badge {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  padding: 5px 14px !important;
}
a { text-decoration-thickness: 0.08em; }
a:hover { color: var(--accent) !important; }
:focus-visible {
  outline: 2px solid #E07B39 !important;
  outline-offset: 2px;
}
.nav-link:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid #F0A26A !important;
}
.site-footer, .site-footer-legal { color: var(--text-secondary); }
.site-footer a { color: var(--accent-2); }

/* Legacy violet tabs (member/quiz/my-account) */
.member-tab.is-active,
.myaccount-menu-item.is-active,
.myaccount-menu-item.active {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.tab-active, .tab.active {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
}

/* Temporarily disable the photo backdrop (theme gallery image); keep flat gradient per theme */
body.has-user-theme-background::before,
body.has-user-theme-background::after {
  display: none !important;
  background-image: none !important;
}
/* Ambient orbs */
.ambient-bg { display: none !important; }
.ambient-bg .orb { display: none !important; }

/* Site traffic stats header — navy */
.site-traffic-stats h2 {
  background: linear-gradient(135deg, #1A3A5C, #3B6B99) !important;
  color: #fff !important;
}
.admin-shell .nav-item.active,
body .nav-item.active {
  background: rgba(26, 58, 92, 0.10) !important;
  color: #1A3A5C !important;
}
.member-tab.is-active {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
}

/* Legal pages — same cool card system */
.legal-card {
  background: #FFFFFF !important;
  border: 1px solid #DCE5EE !important;
  border-radius: 24px !important;
  box-shadow: 0 14px 36px rgba(26, 58, 92, 0.08) !important;
}
.legal-card h1 {
  background: linear-gradient(135deg, #1A3A5C 0%, #3B6B99 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.legal-data-table th {
  background: #F1F6FB !important;
}
body.dark-theme .legal-card {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.18) !important;
}

/* Bookstore/dashboard category "Copy link" chip — teal */
.category-link-copy {
  background: rgba(13, 148, 136, 0.12) !important;
  border-color: rgba(13, 148, 136, 0.30) !important;
}

/* Member create CTA — orange, matching the unified primary */
.member-create-button {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(224, 123, 57, 0.24) !important;
}

/* Admin restraint: keep its own dark header (unified navy would flatten ops UI) */
header.admin-topbar, .admin-topbar, header[data-admin-topbar] {
  background: var(--bg-header, rgba(11, 15, 25, 0.85)) !important;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
}
.admin-shell header, main.admin-topbar {
  background: var(--bg-header, rgba(11, 15, 25, 0.85)) !important;
}
/* The universal header rule must not merge into admin topbar */
header:has(> .admin-topbar) { background: none !important; }
/* Fixed topbar (h≈80, z 2500) covers fixed sidebar (top:0) - clear the top.
   Do not pad the mobile drawer: it starts below the 56px header already. */
#admin-desktop-sidebar:not(.mobile-sidebar-open) {
  padding-top: 80px !important;
  box-sizing: border-box !important;
}
/* Admin primary/compact buttons — orange action */
.btn-primary-sm,
.btn-export-pdf,
#admin-scroll-to-top,
.products-compact-btn.products-compact-primary,
.products-compact-btn--primary {
  background: linear-gradient(135deg, #F0A26A, #E07B39) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.btn-primary-sm:hover,
#admin-scroll-to-top:hover {
  box-shadow: 0 8px 20px rgba(224, 123, 57, 0.28) !important;
}
/* Quizzes toolbar secondary actions (Import/Môn học/Danh mục/Tags/PIN) — cool outline */
#view-quizzes .btn-primary-sm:not(#btn-quizzes-reload):not(#btn-quizzes-create):not(#btn-quizzes-add) {
  background: #F1F6FB !important;
  color: #1A3A5C !important;
  border: 1px solid #C7D8E8 !important;
  background-image: none !important;
}
/* Students header band: clean white instead of legacy gradient */
#view-students .member-management-header {
  background: #FFFFFF !important;
  box-shadow: 0 8px 22px rgba(26, 58, 92, 0.05) !important;
}
body.dark-theme #view-students .member-management-header {
  background: #16293F !important;
}
#view-students .member-management-eyebrow {
  color: #E07B39 !important;
}
/* Range pills: paper, not lavender */
.dash-range-btn {
  background: var(--bg-card, #fff) !important;
  color: var(--text-primary, #0f172a) !important;
}
.dash-range-btn.active {
  background: #F1F6FB !important;
  color: #1A3A5C !important;
  border-color: #C7D8E8 !important;
}

/* 15) Dark theme — cool navy dark that matches the light paper scale */
body.dark-theme {
  background: radial-gradient(120% 100% at 50% 0%, #14293F 0%, #0B1622 70%) !important;
  --bg-primary: #101E2E;
  --bg-secondary: #16293F;
  --bg-tertiary: #1D334C;
  --text-primary: #E9F0F7;
  --text-secondary: #A9BACB;
  --text-muted: #8496A8;
  --primary: #4A739E;
  --accent: #F0A26A;
  --accent-2: #2DD4BF;
  --glass-border: rgba(220, 229, 238, 0.16);
}
body.dark-theme header {
  background: linear-gradient(135deg, #16293F 0%, #122338 55%, #0D1B2B 100%) !important;
}
body.dark-theme .glass-card,
body.dark-theme .quiz-card,
body.dark-theme .quiz-product-card,
body.dark-theme .modal-box {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.16) !important;
  color: #E9F0F7 !important;
}
body.dark-theme .question-card,
body.dark-theme .arena-palette-card,
body.dark-theme .arena-title-bar {
  background: #16293F !important;
  color: #E9F0F7 !important;
}

/* ==========================================================================
   18) UI FIXES (tu tools/ui-audit.mjs)
   ========================================================================== */

/* Anh bia sach khong co anh: hien o trang tri thay vi tai anh hong. */
.quiz-cover-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, var(--ds-tint-sky, #D6E6F5) 0%, var(--ds-tint-peach, #FBE3D0) 100%);
  color: var(--ds-navy, #1A3A5C);
}

.quiz-cover-img-fallback ion-icon {
  font-size: 40px;
}

/* The minh hoa thu hai trong hero tran ra ngoai khung o man hinh hep. */
@media (max-width: 640px) {
  #view-landing .landing-graphic .landing-card-2 {
    right: 0;
    bottom: -14px;
    width: 86%;
  }
}

/* Vung bam toi thieu 32px (chan trang + nut sao chep danh muc). */
.category-link-copy {
  min-height: 32px;
}

@media (max-width: 768px) {
  .site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
  }
  /* Tieu de san pham trong store chi cao 20px - duoi cham tay 32px. */
  .quiz-card-title a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
  }
  /* O chon 16px la vung cham khong xung cho ngon tay. */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
    accent-color: var(--ds-orange, #E07B39);
  }
}

/* ==========================================================================
   16) STICKER COMPONENT LAYER (marketing surfaces)
   --------------------------------------------------------------------------
   The reference language is not "soft shadow". It is a hard-offset sticker
   look: zero-blur offset shadows, 2.5px borders, large radii, pastel tiles
   and pill chips. Measured on the reference: --bw 2.5px, --r 26px,
   --r-sm 16px, box-shadow "5px 6px 0 var(--primary)", 360 pill radii.
   Scoped to the storefront landing: the exam room and the admin stay flat
   and quiet, because dense working surfaces do not want stickers.
   ========================================================================== */

:root,
body {
  --ds-navy: #1A3A5C;
  --ds-navy-soft: #E1E9F2;
  --ds-ink: #2D3748;
  --ds-ink-muted: #5F6E82;
  --ds-line: #DCE5EE;
  --ds-orange: #E67E22;
  --ds-orange-dark: #D35400;
  --ds-tint-mint: #CFEBDD;
  --ds-tint-sky: #D6E6F5;
  --ds-tint-peach: #FBE3D0;
  --ds-tint-sun: #F6C453;
  --ds-bw: 2.5px;
  --ds-r-lg: 26px;
  --ds-r-md: 16px;
  --ds-sh-1: 2px 3px 0 var(--ds-navy);
  --ds-sh-2: 3px 4px 0 var(--ds-navy);
  --ds-sh-3: 5px 6px 0 var(--ds-orange);
  --ds-sh-4: 7px 8px 0 var(--ds-navy);
}

/* --- Sticker surface: the shared card treatment --- */
#view-landing .glass-card,
#view-landing .lp-product {
  background: #FFFFFF !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-sh-2) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* --- Hero --- */
#view-landing .hero-title {
  color: var(--ds-navy) !important;
  font-size: 44px !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em;
}
#view-landing .hero-title span {
  background: linear-gradient(135deg, var(--ds-orange) 0%, var(--ds-orange-dark) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
#view-landing .hero-subtitle {
  color: var(--ds-ink) !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
}
#view-landing .hero-badge {
  background: var(--ds-tint-peach) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: 999px !important;
  color: var(--ds-navy) !important;
  font-weight: 800 !important;
  box-shadow: var(--ds-sh-1) !important;
}
#view-landing .lp-hero-note {
  color: var(--ds-ink-muted) !important;
}

/* Hero buttons: pill + hard offset shadow */
#view-landing .btn-hero {
  border-radius: 999px !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  padding: 13px 26px !important;
  box-shadow: var(--ds-sh-1) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#view-landing .btn-hero:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--ds-sh-2) !important;
}
#view-landing .btn-hero.btn-accent {
  background: var(--ds-tint-sky) !important;
  color: var(--ds-navy) !important;
  border-color: var(--ds-navy) !important;
  box-shadow: var(--ds-sh-1) !important;
}

/* Hero mock cards */
#view-landing .landing-card {
  box-shadow: var(--ds-sh-3) !important;
}
#view-landing .landing-card-2 {
  background: var(--ds-tint-mint) !important;
  box-shadow: var(--ds-sh-2) !important;
}
#view-landing .lp-chip {
  border-radius: 999px !important;
  border: 1.5px solid var(--ds-navy) !important;
  background: var(--ds-tint-peach) !important;
  color: var(--ds-navy) !important;
}
#view-landing .lp-doc-title,
#view-landing .lp-check-title {
  color: var(--ds-navy) !important;
}
#view-landing .lp-doc-lines span {
  background: linear-gradient(90deg, rgba(26, 58, 92, 0.32), rgba(26, 58, 92, 0.14)) !important;
}
#view-landing .lp-doc-answer {
  background: var(--ds-tint-mint) !important;
  border: 1.5px solid var(--ds-navy) !important;
  border-radius: var(--ds-r-md) !important;
  color: #1F5137 !important;
}
#view-landing .lp-check-item {
  color: var(--ds-ink) !important;
}
#view-landing .lp-check-item + .lp-check-item {
  border-top-color: var(--ds-line) !important;
}

/* --- Section headings --- */
#view-landing .landing-features-title,
#view-landing .lp-title {
  color: var(--ds-navy) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  letter-spacing: -0.02em;
}
#view-landing .lp-section-sub {
  color: var(--ds-ink-muted) !important;
}

/* --- Feature cards + pastel icon tiles --- */
@media (min-width: 1100px) {
  /* 3 columns keeps 6 features at 3+3 and 5 at 3+2 - the reference layout.
     The old auto-fit/280px left a single orphan card on its own row. */
  #view-landing .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
#view-landing .feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ds-sh-3) !important;
}
#view-landing .feature-card h3 {
  color: var(--ds-navy) !important;
}
#view-landing .feature-card p {
  color: var(--ds-ink) !important;
}
#view-landing .feature-icon-wrapper {
  width: 56px !important;
  height: 56px !important;
  border-radius: var(--ds-r-md) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  box-shadow: var(--ds-sh-1) !important;
  font-size: 26px !important;
}
#view-landing .feat-1 { background: var(--ds-tint-mint) !important; color: #1F5137 !important; border-color: var(--ds-navy) !important; }
#view-landing .feat-2 { background: var(--ds-tint-sky) !important; color: #1A3A5C !important; border-color: var(--ds-navy) !important; }
#view-landing .feat-3 { background: var(--ds-tint-peach) !important; color: #8A4B12 !important; border-color: var(--ds-navy) !important; }
#view-landing .feat-4 { background: var(--ds-tint-sun) !important; color: #6B4A06 !important; border-color: var(--ds-navy) !important; }
#view-landing .feat-5 { background: var(--ds-tint-rose, #F7D4DC) !important; color: #8E2E4A !important; border-color: var(--ds-navy) !important; }
#view-landing .feat-6 { background: var(--ds-tint-mint) !important; color: #1F5137 !important; border-color: var(--ds-navy) !important; }

/* --- Level picker --- */
#view-landing .lp-level-card {
  background: #FFFFFF !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-sh-2) !important;
  color: inherit !important;
  text-decoration: none !important;
}
#view-landing .lp-level-card:hover {
  box-shadow: var(--ds-sh-3) !important;
}
#view-landing .lp-level-icon {
  background: var(--ds-tint-sky) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  box-shadow: var(--ds-sh-1) !important;
  color: var(--ds-navy) !important;
}
#view-landing .lp-level-name {
  color: var(--ds-navy) !important;
}
#view-landing .lp-level-pill {
  background: var(--ds-tint-mint) !important;
  border: 1.5px solid var(--ds-navy) !important;
  color: #1F5137 !important;
}
#view-landing .lp-level-go {
  color: var(--ds-orange-dark) !important;
}

/* --- Stats band --- */
#view-landing .stats-bar {
  background: #FFFFFF !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-sh-2) !important;
}
#view-landing .stat-num {
  background: linear-gradient(135deg, var(--ds-navy) 0%, var(--ds-orange) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-weight: 800 !important;
  font-size: 38px !important;
  letter-spacing: -0.03em;
}
#view-landing .stat-label {
  color: var(--ds-ink-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

/* --- Steps --- */
#view-landing .lp-step-num {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: var(--ds-orange) !important;
  color: #FFFFFF !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  box-shadow: var(--ds-sh-1) !important;
  font-size: 20px !important;
}
#view-landing .lp-step h3 {
  color: var(--ds-navy) !important;
}
#view-landing .lp-step p {
  color: var(--ds-ink) !important;
}

/* --- Included chips --- */
#view-landing .lp-included-chip {
  background: #FFFFFF !important;
  border: var(--ds-bw) solid var(--ds-line) !important;
  border-radius: 999px !important;
  color: var(--ds-ink) !important;
  font-weight: 700 !important;
}

/* --- Product cards --- */
#view-landing .lp-product:hover {
  transform: translateY(-4px);
  box-shadow: var(--ds-sh-3) !important;
}
#view-landing .lp-product-cover {
  background: linear-gradient(135deg, var(--ds-tint-sky) 0%, var(--ds-tint-peach) 100%) !important;
  border-bottom: var(--ds-bw) solid var(--ds-navy) !important;
}
#view-landing .lp-product-cat {
  background: var(--ds-navy) !important;
  border: 1.5px solid var(--ds-navy) !important;
  border-radius: 999px !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
}
#view-landing .lp-product-title {
  color: var(--ds-navy) !important;
}
#view-landing .lp-product-price {
  color: var(--ds-orange-dark) !important;
}
#view-landing .lp-product-sales {
  color: var(--ds-ink-muted) !important;
}

/* --- Promo band --- */
#view-landing .lp-sub-card {
  background: var(--ds-tint-mint) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-sh-2) !important;
}
#view-landing .lp-sub-card h3 {
  color: var(--ds-navy) !important;
}
#view-landing .lp-sub-card p {
  color: var(--ds-ink) !important;
}
#view-landing .lp-sub-card > ion-icon {
  color: var(--ds-navy) !important;
}

/* --- FAQ --- */
#view-landing .lp-faq-item {
  border: var(--ds-bw) solid var(--ds-line) !important;
  border-radius: 20px !important;
  box-shadow: var(--ds-sh-1) !important;
}
#view-landing .lp-faq-item summary {
  color: var(--ds-navy) !important;
}
#view-landing .lp-faq-item summary::after {
  color: var(--ds-orange) !important;
  font-weight: 800;
}
#view-landing .lp-faq-item p {
  color: var(--ds-ink) !important;
}

/* --- Final CTA --- */
#view-landing .lp-final-cta {
  background: linear-gradient(135deg, var(--ds-orange) 0%, var(--ds-orange-dark) 100%) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-sh-4) !important;
  padding: 60px 24px !important;
}
#view-landing .lp-final-cta h2 {
  color: #FFFFFF !important;
}
#view-landing .lp-final-cta p {
  color: rgba(255, 255, 255, 0.88) !important;
}
#view-landing .lp-final-cta .btn {
  background: #FFFFFF !important;
  color: var(--ds-navy) !important;
  border: var(--ds-bw) solid var(--ds-navy) !important;
  border-radius: 999px !important;
  box-shadow: var(--ds-sh-1) !important;
}

/* --- Sticker layer, dark theme ------------------------------------------
   The sticker surface is a light-theme treatment. In dark mode the same
   cards must go back to the cool dark surfaces, or the landing shows a
   white card grid on a dark page. */
body.dark-theme #view-landing .glass-card,
body.dark-theme #view-landing .lp-product,
body.dark-theme #view-landing .lp-included-chip,
body.dark-theme #view-landing .lp-faq-item {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.18) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
}
body.dark-theme #view-landing .hero-title,
body.dark-theme #view-landing .lp-title,
body.dark-theme #view-landing .landing-features-title,
body.dark-theme #view-landing .feature-card h3,
body.dark-theme #view-landing .lp-step h3,
body.dark-theme #view-landing .lp-product-title,
body.dark-theme #view-landing .lp-doc-title,
body.dark-theme #view-landing .lp-check-title,
body.dark-theme #view-landing .lp-faq-item summary,
body.dark-theme #view-landing .lp-sub-card h3 {
  color: #E9F0F7 !important;
}
body.dark-theme #view-landing .hero-subtitle,
body.dark-theme #view-landing .feature-card p,
body.dark-theme #view-landing .lp-step p,
body.dark-theme #view-landing .lp-product-sales,
body.dark-theme #view-landing .lp-hero-note,
body.dark-theme #view-landing .lp-section-sub,
body.dark-theme #view-landing .stat-label,
body.dark-theme #view-landing .lp-faq-item p,
body.dark-theme #view-landing .lp-sub-card p,
body.dark-theme #view-landing .lp-check-item {
  color: #A9BACB !important;
}
body.dark-theme #view-landing .feature-icon-wrapper {
  border-color: rgba(220, 229, 238, 0.24) !important;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45) !important;
}
body.dark-theme #view-landing .hero-badge,
body.dark-theme #view-landing .lp-chip {
  background: #2A2016 !important;
  border-color: rgba(240, 162, 106, 0.35) !important;
  color: #F0A26A !important;
}
body.dark-theme #view-landing .lp-doc-answer {
  background: #1B3B2E !important;
  border-color: rgba(220, 229, 238, 0.24) !important;
  color: #9AE6B4 !important;
}
body.dark-theme #view-landing .lp-product-cover {
  background: linear-gradient(135deg, #1B3450 0%, #2A2016 100%) !important;
  border-bottom-color: rgba(220, 229, 238, 0.18) !important;
}
body.dark-theme #view-landing .lp-product-cat {
  background: #0E1E30 !important;
  border-color: rgba(220, 229, 238, 0.25) !important;
}
body.dark-theme #view-landing .lp-sub-card {
  background: #1B3450 !important;
  border-color: rgba(220, 229, 238, 0.18) !important;
}
body.dark-theme #view-landing .lp-step-num {
  background: var(--ds-orange) !important;
  border-color: rgba(220, 229, 238, 0.3) !important;
}
body.dark-theme #view-landing .lp-final-cta {
  box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.55) !important;
}
body.dark-theme #view-landing .lp-level-card {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.18) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
}
body.dark-theme #view-landing .lp-level-icon {
  background: #1B3450 !important;
  border-color: rgba(220, 229, 238, 0.24) !important;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45) !important;
  color: #E9F0F7 !important;
}
body.dark-theme #view-landing .lp-level-name {
  color: #E9F0F7 !important;
}
body.dark-theme #view-landing .lp-level-pill {
  background: #1B3B2E !important;
  border-color: rgba(220, 229, 238, 0.24) !important;
  color: #9AE6B4 !important;
}
body.dark-theme #view-landing .lp-level-go {
  color: #F0A26A !important;
}

/* ==========================================================================
   17) MOTION
   --------------------------------------------------------------------------
   The page is long and mostly static, so it needs a little life: sections
   rise in as they appear, cards pop in with a small stagger, the primary
   button catches a light sweep. Every rule is opt-in per element and the
   whole block is disabled under prefers-reduced-motion.
   ========================================================================== */

@keyframes ds-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes ds-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.97); }
  100% { opacity: 1; transform: none; }
}

@keyframes ds-sweep {
  0% { transform: translateX(-120%) skewX(-18deg); }
  60%, 100% { transform: translateX(220%) skewX(-18deg); }
}

@keyframes ds-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

#view-landing .lp-section {
  animation: ds-rise 0.5s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

#view-landing .lp-level-card {
  animation: ds-pop 0.42s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

#view-landing .lp-level-card:nth-child(1) { animation-delay: 0.04s; }
#view-landing .lp-level-card:nth-child(2) { animation-delay: 0.09s; }
#view-landing .lp-level-card:nth-child(3) { animation-delay: 0.14s; }
#view-landing .lp-level-card:nth-child(4) { animation-delay: 0.19s; }
#view-landing .lp-level-card:nth-child(5) { animation-delay: 0.24s; }
#view-landing .lp-level-card:nth-child(6) { animation-delay: 0.29s; }
#view-landing .lp-level-card:nth-child(7) { animation-delay: 0.34s; }
#view-landing .lp-level-card:nth-child(8) { animation-delay: 0.39s; }
#view-landing .lp-level-card:nth-child(n + 9) { animation-delay: 0.44s; }
/* Modern equivalent of the nth-child stagger; the cap keeps the nth-child(n+9) behavior. Older browsers keep the rules above. */
#view-landing .lp-level-card:nth-child(n) { animation-delay: min(0.44s, calc(0.05s * sibling-index() - 0.01s)); }

#view-landing .hero-title span {
  background-size: 200% auto;
  animation: ds-shine 7s ease-in-out infinite;
}

/* A light sweep across the primary action button. */
#view-landing .btn-primary,
#view-landing .btn-hero {
  position: relative;
  overflow: hidden;
}

#view-landing .btn-primary::after,
#view-landing .btn-hero::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 255, 255, 0) 100%);
  animation: ds-sweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

.lp-level-dialog[open] {
  animation: ds-pop 0.28s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  #view-landing *,
  #view-landing *::before,
  #view-landing *::after,
  .lp-level-dialog,
  .lp-level-dialog * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Level dialog, dark theme --- */
body.dark-theme .lp-level-dialog {
  background: #16293F !important;
  border-color: rgba(220, 229, 238, 0.22) !important;
  box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.55) !important;
  color: #E9F0F7 !important;
}
body.dark-theme .lp-level-dialog-head {
  border-bottom-color: rgba(220, 229, 238, 0.16) !important;
}
body.dark-theme .lp-level-dialog-title {
  color: #E9F0F7 !important;
}
body.dark-theme .lp-level-dialog-close {
  background: #1B3450 !important;
  border-color: rgba(220, 229, 238, 0.24) !important;
  color: #E9F0F7 !important;
}
body.dark-theme .lp-level-dialog-h,
body.dark-theme .lp-level-dialog-empty {
  color: #A9BACB !important;
}
body.dark-theme .lp-level-path-title {
  background: #1B3450 !important;
  border-color: rgba(220, 229, 238, 0.24) !important;
  color: #E9F0F7 !important;
}
body.dark-theme .lp-level-unit {
  background: #101E2E !important;
  border-color: rgba(220, 229, 238, 0.2) !important;
  color: #A9BACB !important;
}
body.dark-theme .lp-level-dialog-cta {
  background: var(--ds-orange) !important;
  color: #fff !important;
}

/* Nút tròn trên header (theme + giỏ hàng): giữ nền mờ + viền rõ trên nền navy. */
header .theme-toggle-btn,
header .cart-toggle-btn {
  border: 1.5px solid rgba(255, 255, 255, 0.34) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

header .theme-toggle-btn:hover,
header .cart-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}