/**
 * Jolly Scholar - Global CSS Theme
 * Design: Deep Purple (#6B2FA3) with Cream (#F5E6D3) accents
 * Tagline: Learn to Earn
 */

/* ============================================
   CSS VARIABLES & ROOT STYLES
   ============================================ */

:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --card: #f8fafc;
  --card-text: #0f172a;
  --primary: #3B82F6;
  --secondary: #8B5CF6;
  --accent: #06B6D4;
  --success: #10B981;
  --bg: var(--background);
  --text: var(--foreground);
  --text-strong: var(--card-text);
  --muted: #64748b;
  --surface-muted: #eef2ff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --primary-start: var(--primary);
  --primary-end: var(--secondary);
  --accent-start: var(--accent);
  --accent-end: var(--success);
  --warning: #D4A574;
  --error: #ef4444;
  --shadow: 0 10px 30px rgba(107, 47, 163, 0.08);
  --shadow-lg: 0 20px 50px rgba(107, 47, 163, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

html.theme-preload-dark body,
body.theme-dark {
  --background: #0F172A;
  --foreground: #F8FAFC;
  --card: #1E293B;
  --card-text: #F8FAFC;
  --bg: var(--background);
  --text: var(--foreground);
  --text-strong: var(--card-text);
  --muted: #CBD5E1;
  --surface-muted: #273449;
  --border: #334155;
  --border-light: #293548;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.34);
}

html.theme-preload-dark body .site-header,
html.theme-preload-dark body .site-footer,
html.theme-preload-dark body .card,
html.theme-preload-dark body .sidebar-section,
html.theme-preload-dark body .tab-list,
html.theme-preload-dark body .tab-button,
html.theme-preload-dark body input,
html.theme-preload-dark body select,
html.theme-preload-dark body textarea,
html.theme-preload-dark body table,
html.theme-preload-dark body .modal,
html.theme-preload-dark body .toast,
body.theme-dark .site-header,
body.theme-dark .site-footer,
body.theme-dark .card,
body.theme-dark .sidebar-section,
body.theme-dark .tab-list,
body.theme-dark .tab-button,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark table,
body.theme-dark .modal,
body.theme-dark .toast {
  background-color: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html.theme-preload-dark body input,
html.theme-preload-dark body select,
html.theme-preload-dark body textarea,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  color-scheme: dark;
}

html.theme-preload-dark body .button-secondary:hover,
html.theme-preload-dark body .nav-link:hover,
body.theme-dark .button-secondary:hover,
body.theme-dark .nav-link:hover {
  color: var(--primary);
}

html.theme-preload-dark body .footer-links a,
html.theme-preload-dark body .sidebar-menu a,
html.theme-preload-dark body .nav-link,
body.theme-dark .footer-links a,
body.theme-dark .sidebar-menu a,
body.theme-dark .nav-link {
  color: var(--text);
}

html.theme-preload-dark body .course-card,
html.theme-preload-dark body .landing-card,
html.theme-preload-dark body .landing-step,
html.theme-preload-dark body .landing-stat,
html.theme-preload-dark body .feature-box,
html.theme-preload-dark body .step,
html.theme-preload-dark body .filter-card,
html.theme-preload-dark body .telegram-card,
html.theme-preload-dark body .qr-card,
html.theme-preload-dark body .policy-document,
body.theme-dark .course-card,
body.theme-dark .landing-card,
body.theme-dark .landing-step,
body.theme-dark .landing-stat,
body.theme-dark .feature-box,
body.theme-dark .step,
body.theme-dark .filter-card,
body.theme-dark .telegram-card,
body.theme-dark .qr-card,
body.theme-dark .policy-document {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html.theme-preload-dark body .feature-band,
html.theme-preload-dark body .steps-band,
html.theme-preload-dark body .feature-grid,
html.theme-preload-dark body .steps-grid,
body.theme-dark .feature-band,
body.theme-dark .steps-band,
body.theme-dark .feature-grid,
body.theme-dark .steps-grid {
  background: var(--background);
  color: var(--text);
}

html.theme-preload-dark body .course-card *,
html.theme-preload-dark body .landing-card *,
html.theme-preload-dark body .landing-step *,
html.theme-preload-dark body .landing-stat *,
html.theme-preload-dark body .feature-box *,
html.theme-preload-dark body .step *,
body.theme-dark .course-card *,
body.theme-dark .landing-card *,
body.theme-dark .landing-step *,
body.theme-dark .landing-stat *,
body.theme-dark .feature-box *,
body.theme-dark .step * {
  color: inherit;
}

.feature-box:hover,
.step:hover,
.landing-card:hover,
.landing-step:hover,
.course-card:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 44px rgba(59, 130, 246, 0.16);
  transform: translateY(-2px);
}

html.theme-preload-dark body .button-primary,
body.theme-dark .button-primary,
html.theme-preload-dark body .button-secondary,
body.theme-dark .button-secondary,
html.theme-preload-dark body .button-danger,
body.theme-dark .button-danger,
html.theme-preload-dark body .btn-logout,
body.theme-dark .btn-logout {
  color: #fff;
}

html.theme-preload-dark body .button-secondary,
body.theme-dark .button-secondary {
  color: var(--text);
}

html.theme-preload-dark body a,
body.theme-dark a {
  color: #93c5fd;
}

html.theme-preload-dark body :where(
  .site-main,
  .page-header,
  .landing-section,
  .feature-band,
  .steps-band,
  .feature-grid,
  .steps-grid,
  .dashboard-content,
  .dashboard-sidebar,
  .card,
  .course-card,
  .feature-box,
  .step,
  .table-card,
  .modal,
  .site-footer
) :where(h1, h2, h3, h4, h5, h6, p, li, label, legend, summary, td, th, dt, dd, strong, small, span),
body.theme-dark :where(
  .site-main,
  .page-header,
  .landing-section,
  .feature-band,
  .steps-band,
  .feature-grid,
  .steps-grid,
  .dashboard-content,
  .dashboard-sidebar,
  .card,
  .course-card,
  .feature-box,
  .step,
  .table-card,
  .modal,
  .site-footer
) :where(h1, h2, h3, h4, h5, h6, p, li, label, legend, summary, td, th, dt, dd, strong, small, span) {
  color: var(--text);
}

html.theme-preload-dark body :where(.text-muted, .text-small, .course-meta span, .footer-bottom p),
body.theme-dark :where(.text-muted, .text-small, .course-meta span, .footer-bottom p) {
  color: var(--muted) !important;
}

html.theme-preload-dark body :where(.button-primary, .button-danger, .btn-logout, .hero-slide-panel, .hero-slide-panel *, .coin-icon),
body.theme-dark :where(.button-primary, .button-danger, .btn-logout, .hero-slide-panel, .hero-slide-panel *, .coin-icon) {
  color: #fff;
}

html.theme-preload-dark body :where(.badge, .jskt-chip, .status-badge),
body.theme-dark :where(.badge, .jskt-chip, .status-badge) {
  color: var(--text-strong);
}

html.theme-preload-dark body .button-secondary,
body.theme-dark .button-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html.theme-preload-dark body .button-secondary:hover,
body.theme-dark .button-secondary:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  font-weight: 700;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.3;
}

h3 {
  font-size: 1.875rem;
  line-height: 1.4;
}

p {
  margin: 0 0 1rem;
  color: var(--text);
}

.text-muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.text-small {
  font-size: 0.875rem;
}

.font-weight-bold {
  font-weight: 700;
}

/* ============================================
   LAYOUT & CONTAINERS
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1.5rem;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: width 0.3s ease, padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-radius 0.3s ease, top 0.3s ease;
}

.site-header.is-compact {
  width: min(960px, calc(100% - 1.5rem));
  margin: 0.75rem auto 0;
  padding: 0.45rem 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.site-header.is-compact .header-content {
  padding: 0 0.9rem;
  position: relative;
}

.site-header.is-compact .brand-with-logo img {
  width: 2rem;
  height: 2rem;
}

.site-header.is-compact .site-nav {
  display: none;
}

.site-header.is-compact .nav-actions {
  display: none;
}

.site-header.is-compact .nav-toggle {
  display: inline-flex;
}

.site-header.is-compact .site-nav.open {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 120;
  display: flex;
  width: min(24rem, calc(100vw - 2rem));
  min-height: 0;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.2);
}

.site-header.is-compact .site-nav.open .nav-actions,
body.nav-open .site-header.is-compact .site-nav.open .nav-actions {
  position: static;
  display: flex;
  width: 100%;
  padding: 0.25rem 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  margin: 0;
}

.brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-strong);
}

.brand-with-logo img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-with-logo span {
  background: linear-gradient(90deg, var(--primary-start), #2563eb 55%, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-start);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.nav-toggle span {
  width: 1.15rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

body.nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 105;
  pointer-events: none;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.signin-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(5.5rem, 1fr));
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(107, 47, 163, 0.08);
}

.signin-toggle-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
}

.signin-student {
  color: #4c1d95;
  background: #f3e8ff;
}

.signin-creator {
  color: #075985;
  background: #ecfeff;
}

.signin-student:hover {
  color: #fff;
  background: linear-gradient(90deg, #6b21a8, #9333ea);
}

.signin-creator:hover {
  color: #fff;
  background: linear-gradient(90deg, #0e7490, #7c3aed);
}

.btn-logout {
  background: var(--error);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-logout:hover {
  opacity: 0.9;
}

/* ============================================
   BUTTONS & FORM ELEMENTS
   ============================================ */

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border: none;
  color: white;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.button-primary:active {
  transform: translateY(0);
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  color: var(--text-strong);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  text-decoration: none;
}

.button-secondary:hover {
  border-color: var(--primary-start);
  color: var(--primary-start);
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-strong);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--primary-start);
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--muted);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.theme-toggle-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  width: 2.65rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #d8c7eb;
  transition: background 0.2s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 0.18rem;
  left: 0.2rem;
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(45, 31, 58, 0.22);
  transition: transform 0.2s ease;
}

.theme-toggle-label {
  min-width: 2.35rem;
  text-align: left;
}

.theme-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, #1E293B, #312E81);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-track {
  background: #7c3aed;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
  transform: translateX(1.16rem);
}

.theme-toggle[aria-pressed="false"] .theme-sun,
.theme-toggle[aria-pressed="true"] .theme-moon {
  color: var(--primary-start);
}

.theme-toggle[aria-pressed="false"] .theme-moon,
.theme-toggle[aria-pressed="true"] .theme-sun {
  opacity: 0.52;
}

.disabled-action {
  opacity: 0.72;
  cursor: not-allowed;
  pointer-events: none;
}

.button-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border: none;
  color: white;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.button-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border: none;
  color: white;
  border-radius: 999px;
  background: var(--error);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity 0.2s;
  text-decoration: none;
}

.button-danger:hover {
  opacity: 0.9;
}

button[disabled],
.button-primary[disabled],
.button-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Elements */
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--text-strong);
  transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-strong);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.5rem;
}

.password-toggle {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 700;
  padding: 0 0.85rem;
  min-width: 4.5rem;
}

input::placeholder,
textarea::placeholder {
    /* Fallback for all old browsers */
  color: var(--muted);
  opacity: 0.74; 
    /* Modern browsers will use this instead and ignore the opacity above */
  color: color-mix(in srgb, var(--muted) 74%, transparent);
  opacity: 1; /* Reset opacity so it doesn't double-apply */
} 
.input-error {
  border-color: var(--error) !important;
}

.alert {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: #f0fdf4;
  border-color: var(--success);
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--error);
  color: #7f1d1d;
}

.alert-danger {
  background: #fef2f2;
  border-color: var(--error);
  color: #7f1d1d;
}

.alert-warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: #f0f9ff;
  border-color: var(--primary-start);
  color: #0c2340;
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.2);
}

.card-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.card-body {
  padding: 0;
}

.card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  margin-top: 1rem;
}

.metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-start);
  margin: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

/* ============================================
   GRID & LAYOUT
   ============================================ */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, #f0f9ff 100%);
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.hero p {
  color: #4b5563;
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 3rem 0;
}

.feature-item {
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-item h3 {
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
}

/* ============================================
   HEADER/MAIN CONTENT AREA
   ============================================ */

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.sidebar-collapse-toggle {
  display: none !important;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.sidebar-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.sidebar-section h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
}

.sidebar-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
  color: var(--primary-start);
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* ============================================
   COURSE CARDS & LISTING
   ============================================ */

.course-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.course-card[hidden] {
  display: none !important;
}

.course-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.2);
}

.course-header {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  padding: 2rem 1.5rem;
  color: white;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.course-header h3 {
  color: white;
  margin: 0;
  font-size: 1.25rem;
}

.course-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 15rem;
}

.course-description {
  color: var(--text);
  margin-bottom: 1rem;
  flex-grow: 1;
  overflow-wrap: anywhere;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--muted);
}

.course-meta-item {
  display: flex;
  flex-direction: column;
}

.course-meta-value {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 1.125rem;
}

.course-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.5rem 1.5rem;
  margin-top: auto;
}

.course-footer a {
  flex: 1;
  text-align: center;
}

/* ============================================
   VERIFIED BADGE
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-verified {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
  color: var(--success);
}

.badge-pending {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
  color: var(--warning);
}

.badge-rejected {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 115, 0.1));
  color: var(--error);
}

/* ============================================
   TABLES
   ============================================ */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-strong);
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.table tr:hover {
  background: var(--bg);
}

/* ============================================
   MODALS & OVERLAYS
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ============================================
   WALLET CONNECT MODAL
   ============================================ */

.wallet-modal {
  min-width: 350px;
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wallet-option {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: var(--bg);
}

.wallet-option:hover {
  border-color: var(--primary-start);
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.wallet-option-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.wallet-option-name {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.25rem;
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: var(--muted);
}

.status-banned {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard {
  background: var(--card);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}

.leaderboard-entry:hover {
  background: var(--bg);
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--primary-start);
  min-width: 50px;
  font-size: 1.25rem;
}

.leaderboard-rank.gold { color: #d97706; }
.leaderboard-rank.silver { color: #9ca3af; }
.leaderboard-rank.bronze { color: #b45309; }

.leaderboard-info {
  flex-grow: 1;
  margin: 0 1.5rem;
}

.leaderboard-name {
  font-weight: 600;
  color: var(--text-strong);
}

.leaderboard-score {
  font-weight: 700;
  color: var(--primary-start);
  text-align: right;
}

/* ============================================
   LOADING & STATES
   ============================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.1);
  border-top-color: var(--primary-start);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--text-strong);
  font-size: 1.25rem;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--text-strong);
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-start);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .container {
    padding: 0 1rem;
  }
  
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1rem 2rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-ctas a,
  .hero-ctas button {
    width: 100%;
  }
  
  .site-header {
    padding: 1rem 0;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
    margin-right: 0;
  }
  
  .button-primary,
  .button-secondary {
    width: 100%;
  }
  
  .metrics {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    margin-bottom: 1.5rem;
  }
  
  .table {
    font-size: 0.85rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .site-main {
    padding: 1rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .button-primary,
  .button-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.site-footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero {
  text-align: center;
  padding: 3rem 2rem;
}

.hero h1 {
  color: var(--text-strong);
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.hero p {
  color: #4b5563;
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.button-primary,
.button-secondary {
  border-radius: 999px;
  padding: 0.95rem 1.8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.button-primary {
  color: white;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.button-secondary {
  color: var(--text-strong);
  background: white;
  border: 1px solid var(--border);
}

.features h2,
.dashboard-title {
  color: var(--text-strong);
  margin-top: 0;
}

.text-muted {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-link {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  color: #374151;
  background: #f8fafc;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
}

.tab-link:hover {
  background: #eff6ff;
  color: var(--primary-start);
}

.session-pill {
  max-width: 18rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-button {
  padding: 0.65rem 1rem;
}

.mock-panel,
.section-heading {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.section-heading {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-heading p {
  color: var(--muted);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.role-card,
.account-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.credential-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: var(--bg);
  font-size: 0.9rem;
}

.credential-list dt {
  color: var(--muted);
  font-weight: 700;
}

.credential-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-shell {
  max-width: 560px;
  margin: 3rem auto;
}

.auth-shell-wide {
  max-width: 920px;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.filter-card input,
.filter-card select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-span {
  grid-column: 1 / -1;
}

.course-builder-form textarea {
  resize: vertical;
}

.course-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.course-manage-card {
  display: grid;
  gap: 0.85rem;
}

.creator-signup-fields {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 1rem;
}

.social-list {
  display: grid;
  gap: 0.7rem;
}

.social-list a {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 800;
  background: var(--bg);
}

.social-list a:hover {
  color: #fff;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.about-story {
  background: var(--background);
}

.about-story section,
.about-story .logo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem;
}

.about-story .logo-container {
  text-align: center;
  padding-bottom: 1rem;
}

.about-story .logo-container img {
  width: min(80vw, 30rem);
  margin: 0 auto;
  border-radius: 0;
  box-shadow: none;
}

.about-story .hero-section,
.about-story .cta-section,
.about-story .instructor-section,
.about-story .referral-section,
.about-story .community-section,
.about-story .security-section {
  text-align: center;
}

.about-story .features-section,
.about-story .how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.about-story .features-section h2,
.about-story .how-it-works h2 {
  grid-column: 1 / -1;
  text-align: center;
}

.feature-box,
.step {
  padding: 1.5rem;
  border: 1px solid #eef2f6;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
}

.about-embed-image {
  display: block;
  width: min(92vw, 980px);
  margin: 1rem auto;
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.telegram-landing {
  padding: clamp(2rem, 5vw, 4rem) 1.25rem;
}

.telegram-hero {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.telegram-copy {
  max-width: 680px;
}

.telegram-copy h1 {
  margin-bottom: 1rem;
}

.telegram-copy p {
  max-width: 58ch;
  font-size: 1.08rem;
}

.phone-mock {
  width: min(100%, 390px);
  min-height: 680px;
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid rgba(107, 47, 163, 0.16);
  border-radius: 2rem;
  background: linear-gradient(145deg, #241236, #5b2c88);
  box-shadow: 0 28px 70px rgba(39, 16, 62, 0.25);
}

.phone-speaker {
  width: 5rem;
  height: 0.38rem;
  margin: 0.35rem auto 1rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.34);
}

.telegram-screen {
  min-height: 610px;
  padding: 1rem;
  border-radius: 1.35rem;
  background:
    linear-gradient(180deg, rgba(34, 158, 217, 0.18), transparent 38%),
    #f7fbff;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  overflow: hidden;
}

.telegram-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  color: #ffffff;
  background: linear-gradient(90deg, #229ed9, #6B2FA3);
}

.telegram-message,
.mini-app-card,
.quest-card {
  border: 1px solid rgba(34, 158, 217, 0.18);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(34, 158, 217, 0.08);
}

.telegram-message {
  width: 82%;
  padding: 0.8rem 0.9rem;
  color: #24445b;
}

.mini-app-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
}

.mini-app-card img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.8rem;
}

.mini-app-card span,
.quest-card span {
  display: block;
  color: #5a6f82;
  font-size: 0.88rem;
}

.quest-card {
  padding: 1rem;
}

.quest-card strong {
  display: block;
  margin: 0.2rem 0 0.8rem;
  font-size: 1.15rem;
}

.progress-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 99px;
  background: #e7eef5;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.telegram-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.telegram-actions span {
  min-height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.9rem;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, #6B2FA3, #229ed9);
}

.qr-grid {
  width: min(1180px, 100%);
  margin: clamp(2rem, 5vw, 4rem) auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.qr-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.qr-card h2 {
  margin-top: 1rem;
  font-size: 1.35rem;
}

.qr-card p {
  min-height: 4.5rem;
}

.featured-qr {
  border-color: rgba(107, 47, 163, 0.28);
  box-shadow: 0 24px 50px rgba(107, 47, 163, 0.14);
}

.qr-image {
  display: block;
  width: min(100%, 13rem);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0.65rem;
  border: 1px solid rgba(107, 47, 163, 0.1);
  border-radius: 0.8rem;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}

.qr-code {
  position: relative;
  width: min(100%, 13rem);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 0.7rem solid #ffffff;
  border-radius: 0.8rem;
  background-color: #ffffff;
  background-image:
    linear-gradient(90deg, currentColor 50%, transparent 50%),
    linear-gradient(currentColor 50%, transparent 50%);
  background-size: 1.15rem 1.15rem;
  color: #231035;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 16px 34px rgba(0, 0, 0, 0.1);
}

.qr-code::before,
.qr-code::after,
.qr-code span {
  content: "";
  position: absolute;
  width: 3.4rem;
  height: 3.4rem;
  border: 0.55rem solid currentColor;
  border-radius: 0.35rem;
  background: #ffffff;
}

.qr-code::before {
  top: 0.55rem;
  left: 0.55rem;
}

.qr-code::after {
  top: 0.55rem;
  right: 0.55rem;
}

.qr-code span:first-child {
  left: 0.55rem;
  bottom: 0.55rem;
}

.qr-code span:nth-child(2) {
  right: 2.1rem;
  bottom: 1.3rem;
  width: 1.7rem;
  height: 1.7rem;
  border-width: 0;
  background: currentColor;
}

.qr-code span:nth-child(3) {
  right: 0.55rem;
  bottom: 4.2rem;
  width: 2.2rem;
  height: 2.2rem;
  border-width: 0;
  background: currentColor;
}

.qr-telegram {
  color: #229ed9;
}

.qr-mini {
  color: #6B2FA3;
}

.qr-whatsapp {
  color: #128c7e;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.65rem 1rem;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-links + .footer-links {
  margin-top: 0.5rem;
}

.site-footer h4 a {
  color: inherit;
  text-decoration: none;
}

.site-footer h4 a:hover {
  color: var(--accent);
}

.mobile-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 95;
  display: none;
  width: min(calc(100% - 1rem), 30rem);
  transform: translateX(-50%);
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.mobile-bottom-nav a {
  display: grid;
  min-height: 3.25rem;
  place-items: center;
  gap: 0.15rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.9rem;
  font-weight: 800;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.mobile-bottom-nav a:hover,
.mobile-bottom-nav a:focus-visible {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.mobile-bottom-nav span {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 0.82rem;
}

.mobile-bottom-nav a:hover span,
.mobile-bottom-nav a:focus-visible span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.mobile-bottom-nav small {
  font-size: 0.68rem;
}

.feature-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.feature-list li {
  padding-left: 0.2rem;
}

.account-guide-grid,
.account-summary-card,
.role-guide-card,
.wallet-rules-card {
  align-content: start;
}

.role-guide-card h4 {
  margin: 1rem 0 0.25rem;
  color: var(--text-strong);
}

.field-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.soft-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.funding-card,
.assessment-builder,
.tokenomics-card {
  border-color: rgba(91, 44, 145, 0.18);
}

.assessment-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dynamic-question-fields {
  display: grid;
  gap: 1rem;
}

.assessment-option-grid,
.matching-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.assessment-correct-set {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--bg);
}

.assessment-correct-set legend {
  padding: 0 0.4rem;
  color: var(--text-strong);
  font-weight: 800;
}

.assessment-correct-set label {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
}

.assessment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-muted);
}

.assessment-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.assessment-item button {
  border: 0;
  color: var(--error);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.assessment-result-card strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-strong);
  font-size: 1.1rem;
}

.admin-command-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(260px, 1fr) minmax(300px, 1.2fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.diff-preview {
  max-width: min(70vw, 42rem);
  max-height: 20rem;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-muted);
  color: var(--text);
  white-space: pre-wrap;
}

.transfer-owner-field {
  display: inline-grid;
  max-width: 9rem;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.transfer-owner-field input {
  min-height: 2.25rem;
}

.sponsor-block {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sponsor-logo {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
}

.policy-document {
  display: grid;
  gap: 0.85rem;
  max-width: 980px;
  margin-inline: auto;
  line-height: 1.7;
}

.policy-document h2 {
  margin-top: 0.5rem;
  color: var(--text-strong);
}

.policy-document h3 {
  margin-top: 1rem;
  color: var(--primary-start);
}

.policy-bullet {
  padding-left: 1rem;
  border-left: 3px solid rgba(91, 44, 145, 0.24);
}

.policy-admin-editor {
  max-width: 980px;
  margin: 0 auto 1rem;
}

.course-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.course-header-link {
  display: grid;
  gap: 0.75rem;
  min-height: auto;
  padding: 1rem;
  text-decoration: none;
}

.course-header-link .course-cover {
  border-radius: 0.65rem;
}

.course-header-link h3 {
  align-self: end;
}

.course-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.course-learning-flow,
.course-side-panel {
  display: grid;
  gap: 1rem;
}

.lesson-card,
.quiz-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
}

.lesson-card.locked,
.quiz-panel.locked {
  opacity: 0.55;
}

.lesson-card.locked iframe {
  pointer-events: none;
}

.lesson-card.completed {
  border-color: var(--success);
}

.video-frame,
.document-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.document-placeholder {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
}

.quiz-form fieldset {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.button-row,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.button-row > *,
.table-actions > * {
  flex: 0 1 auto;
}

.tabs[data-tabs] {
  display: grid;
  gap: 1rem;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--card);
}

.tab-button {
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: var(--bg);
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 700;
}

.tab-button.active,
.tab-button:hover {
  border-color: var(--primary-start);
  color: #fff;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.filter-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ============================================
   LANDING PAGE
   ============================================ */

[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-aos].aos-animate {
  opacity: 1;
  transform: none;
}

[data-aos="fade-up"] {
  transform: translate3d(0, 28px, 0);
}

[data-aos="fade-down"] {
  transform: translate3d(0, -28px, 0);
}

[data-aos="fade-right"] {
  transform: translate3d(-32px, 0, 0);
}

[data-aos="fade-left"] {
  transform: translate3d(32px, 0, 0);
}

[data-aos="zoom-in"] {
  transform: scale(0.94);
}

[data-aos="flip-up"] {
  transform: perspective(900px) rotateX(10deg) translate3d(0, 18px, 0);
  transform-origin: bottom center;
}

@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.landing-hero {
  position: relative;
  overflow: hidden;
  width: 100vw;
  min-height: 85vh;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  background: #0f172a;
}

.hero-carousel-track {
  position: relative;
  min-height: inherit;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  min-height: inherit;
  padding: clamp(4.5rem, 8vw, 7rem) clamp(1rem, 7vw, 6rem) clamp(3.5rem, 6vw, 5rem);
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.hero-slide.is-exiting {
  opacity: 0;
  transform: translateX(-24%);
}

.hero-slide.align-left {
  justify-items: start;
}

.hero-slide.align-right {
  justify-items: end;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.hero-slide:first-child img {
  object-fit: contain;
  padding: clamp(1rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 70% 20%, rgba(139, 92, 246, 0.45), transparent 30%),
    linear-gradient(135deg, #111827, #1e1b4b 58%, #0f172a);
}

.hero-slide:first-child {
  align-items: start;
}

.hero-slide:first-child .hero-slide-panel {
  width: min(100%, 34rem);
  margin-top: clamp(4.25rem, 9vh, 6.25rem);
}

.hero-slide:first-child .hero-slide-panel h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.hero-slide:first-child .hero-slide-panel p {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.22) 48%, rgba(15, 23, 42, 0.48)),
    linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.38));
}

.hero-slide-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 36.5rem);
  padding: clamp(1.1rem, 2.8vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.35rem;
  background: rgba(15, 23, 42, 0.46);
  color: #f8fafc;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.34);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.hero-slide-panel h1,
.hero-slide-panel h2 {
  margin-bottom: 1rem;
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-slide-panel p {
  max-width: 40rem;
  color: rgba(248, 250, 252, 0.88);
  font-size: clamp(0.98rem, 1.55vw, 1.14rem);
}

.hero-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.46);
  color: #fff;
  font-size: 2.1rem;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, background 0.25s ease;
}

.hero-carousel-arrow:hover,
.hero-carousel-arrow:focus-visible {
  background: rgba(59, 130, 246, 0.72);
  transform: translateY(-50%) scale(1.05);
}

.hero-carousel-prev {
  left: clamp(0.75rem, 2vw, 1.5rem);
}

.hero-carousel-next {
  right: clamp(0.75rem, 2vw, 1.5rem);
}

.hero-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(1.1rem, 3vw, 2rem);
  z-index: 5;
  display: inline-flex;
  gap: 0.6rem;
  transform: translateX(-50%);
}

.hero-carousel-dot {
  width: 0.72rem;
  height: 0.72rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-carousel-dot.active {
  width: 2rem;
  background: linear-gradient(90deg, var(--primary-start), var(--accent-start));
}

.hero-slide-panel .button-secondary {
  background: rgba(248, 250, 252, 0.12);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.hero-slide-panel .trust-row span {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(248, 250, 252, 0.12);
  color: #e0f2fe;
}

.landing-hero-inner,
.landing-section {
  max-width: 1200px;
  margin: 0 auto;
}

.landing-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.landing-copy h1 {
  max-width: 780px;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #075985;
  font-weight: 800;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 680px;
  color: #475569;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

body.theme-dark .landing-hero {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(8, 145, 178, 0.14)),
    linear-gradient(180deg, var(--background) 0%, #111827 100%);
}

body.theme-dark .hero-lede,
body.theme-dark .text-muted {
  color: var(--muted);
}

body.theme-dark .eyebrow {
  background: rgba(28, 18, 48, 0.88);
  color: #a5f3fc;
}

.landing-logo-panel {
  display: grid;
  place-items: center;
  min-width: 0;
}

.landing-logo-panel img {
  width: min(100%, 34rem);
  max-height: 34rem;
  object-fit: contain;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 28px 45px rgba(76, 29, 149, 0.22));
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.trust-row span {
  padding: 0.55rem 0.8rem;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.landing-section {
  padding: clamp(3rem, 6vw, 5rem) 1.5rem;
}

.intro-band {
  border-bottom: 1px solid var(--border);
}

.landing-metrics,
.feature-grid,
.steps-grid {
  display: grid;
  gap: 1rem;
}

.landing-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}

.landing-stat,
.landing-card,
.landing-step {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.landing-stat {
  padding: 1.25rem;
}

.landing-stat strong {
  display: block;
  color: #4c1d95;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.landing-stat span {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-strong);
  font-weight: 800;
}

.landing-stat p,
.landing-card p,
.landing-step p,
.split-band p,
.final-cta p {
  color: #475569;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-card {
  min-height: 12rem;
  padding: 1.35rem;
}

.landing-card h3,
.landing-step h3 {
  font-size: 1.25rem;
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-step {
  padding: 1.25rem;
}

.landing-step span {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-weight: 900;
}

.split-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.split-band > div,
.final-cta {
  border-radius: 0.85rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
}

.final-cta {
  text-align: center;
  margin-bottom: 2rem;
}

html.theme-preload-dark body :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step),
body.theme-dark :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step) {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
}

html.theme-preload-dark body .landing-stat,
html.theme-preload-dark body .landing-card,
html.theme-preload-dark body .landing-step,
html.theme-preload-dark body .feature-box,
html.theme-preload-dark body .step,
html.theme-preload-dark body .split-band > div,
html.theme-preload-dark body .final-cta,
body.theme-dark .landing-stat,
body.theme-dark .landing-card,
body.theme-dark .landing-step,
body.theme-dark .feature-box,
body.theme-dark .step,
body.theme-dark .split-band > div,
body.theme-dark .final-cta {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}
html.theme-preload-dark body .agreement-box,
body.theme-dark .agreement-box {
  background: var(--surface-muted);
  color: var(--text-strong);
  border-color: rgba(239, 68, 68, 0.32);
}
html.theme-preload-dark body .signin-toggle,
body.theme-dark .signin-toggle {
  background: var(--card);
  border-color: var(--border);
}
html.theme-preload-dark body .landing-stat *,
html.theme-preload-dark body .landing-card *,
html.theme-preload-dark body .landing-step *,
html.theme-preload-dark body .feature-box *,
html.theme-preload-dark body .step *,
html.theme-preload-dark body .split-band > div *,
html.theme-preload-dark body .final-cta *,
body.theme-dark .landing-stat *,
body.theme-dark .landing-card *,
body.theme-dark .landing-step *,
body.theme-dark .feature-box *,
body.theme-dark .step *,
body.theme-dark .split-band > div *,
body.theme-dark .final-cta * {
  color: #0f172a !important;
}

html.theme-preload-dark body :where(.landing-stat, .landing-card, .landing-step, .feature-box, .step, .split-band > div, .final-cta) :where(.button-primary, .button-danger, .btn-logout),
html.theme-preload-dark body :where(.landing-stat, .landing-card, .landing-step, .feature-box, .step, .split-band > div, .final-cta) :where(.button-primary, .button-danger, .btn-logout) *,
body.theme-dark :where(.landing-stat, .landing-card, .landing-step, .feature-box, .step, .split-band > div, .final-cta) :where(.button-primary, .button-danger, .btn-logout),
body.theme-dark :where(.landing-stat, .landing-card, .landing-step, .feature-box, .step, .split-band > div, .final-cta) :where(.button-primary, .button-danger, .btn-logout) * {
  color: #ffffff !important;
}

html.theme-preload-dark body :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step) :where(h1, h2, h3, h4, p, span, small, strong, li, label),
body.theme-dark :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step) :where(h1, h2, h3, h4, p, span, small, strong, li, label) {
  color: #0f172a !important;
}

html.theme-preload-dark body :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step) :where(.text-muted, .text-small, p),
body.theme-dark :where(.split-band > div, .final-cta, .landing-card, .landing-step, .landing-stat, .feature-box, .step) :where(.text-muted, .text-small, p) {
  color: #111827 !important;
}

html.theme-preload-dark body .landing-step > span,
body.theme-dark .landing-step > span {
  background: #ecfeff;
  color: #0f172a !important;
}

html.theme-preload-dark body :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(.card, .sidebar-section, .tab-list, .tab-button, table, thead, tbody, tr, td, th, dl, dt, dd),
body.theme-dark :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(.card, .sidebar-section, .tab-list, .tab-button, table, thead, tbody, tr, td, th, dl, dt, dd),
html.theme-preload-dark body :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card),
body.theme-dark :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html.theme-preload-dark body :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(h1, h2, h3, h4, h5, h6, p, li, label, legend, summary, td, th, dt, dd, strong, span, small),
body.theme-dark :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(h1, h2, h3, h4, h5, h6, p, li, label, legend, summary, td, th, dt, dd, strong, span, small) {
  color: #f8fafc !important;
}

html.theme-preload-dark body :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(.text-muted, .text-small),
body.theme-dark :where(.dashboard-content, .dashboard-sidebar, .admin-command-grid, .tab-panel, .table-card, .admin-filter-bar, .metric-card, .settings-console, .settings-section, .priority-card, .wallet-rules-card, .account-summary-card, .role-guide-card, .funding-card, .tokenomics-card, .assessment-result-card) :where(.text-muted, .text-small) {
  color: #cbd5e1 !important;
}

html.theme-preload-dark body :where(.dashboard-content, .dashboard-sidebar, .tab-panel, .table-card, .admin-filter-bar, .settings-console) :where(input, select, textarea),
body.theme-dark :where(.dashboard-content, .dashboard-sidebar, .tab-panel, .table-card, .admin-filter-bar, .settings-console) :where(input, select, textarea) {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

.role-picker {
  padding-top: 2rem;
}

.reveal-up {
  animation: reveal-up 700ms ease both;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table-card {
  overflow-x: auto;
}

.responsive-table {
  min-width: 760px;
}

.wallet-address {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.wallet-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
}

.task-type-disabled {
  opacity: 0.5;
}

.task-type-disabled input,
.task-type-disabled select {
  background: #e5e7eb;
  cursor: not-allowed;
}

.wallet-education-card {
  display: grid;
  gap: 1rem;
}

.wallet-education-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.wallet-education-heading h3,
.wallet-education-steps h4 {
  margin: 0.2rem 0 0.45rem;
}

.wallet-education-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.wallet-education-steps article {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
}

.wallet-education-steps p,
.wallet-guide-details p {
  margin: 0;
  color: var(--text-muted);
}

.wallet-step-number {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.wallet-guide-details {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.wallet-guide-details summary {
  cursor: pointer;
  font-weight: 800;
}

.wallet-guide-details p {
  margin-top: 0.7rem;
}

.wallet-reward-card {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #3d1767, #6B2FA3 55%, #b8860b);
}

.wallet-reward-card h3,
.wallet-reward-card p {
  color: #fff;
}

.coin-orbit {
  width: 5.2rem;
  height: 5.2rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.coin-icon {
  display: inline-grid;
  place-items: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.25rem;
  border-radius: 50%;
  color: #3d1767;
  font-size: 0.75rem;
  font-weight: 900;
  background: radial-gradient(circle at 30% 30%, #fff8d6, #f4c542 55%, #b8860b);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 8px 18px rgba(39, 16, 62, 0.22);
}

.coin-icon-large {
  width: 4rem;
  height: 4rem;
  font-size: 1rem;
}

.jskt-counter {
  margin: 0;
  color: #fff;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 900;
}

.jskt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-strong);
  font-weight: 800;
}

.task-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.task-card {
  display: grid;
  gap: 0.8rem;
}

.social-proof-form,
.compact-review-form,
.task-config-form {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.task-config-form input[type="number"] {
  max-width: 6rem;
}

.reward-history {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.2rem;
}

.badge-warning {
  color: #7c2d12;
  background: #ffedd5;
}

.opt-out-card {
  border-color: rgba(239, 68, 68, 0.2);
}

.agreement-box {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 0.75rem;
  background: #fff7f7;
  font-weight: 700;
}

.agreement-box input {
  width: auto;
  margin-top: 0.25rem;
}

.settings-grid {
  display: grid;
  gap: 1rem;
}

.settings-console {
  display: grid;
  gap: 1.25rem;
}

.settings-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.priority-card,
.settings-section {
  align-content: start;
}

.settings-section h2,
.priority-card h2 {
  margin-bottom: 1rem;
}

.settings-profile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.settings-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-start);
}

.security-score {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.security-score strong {
  font-size: 2.5rem;
  color: var(--primary-start);
  line-height: 1;
}

.settings-status-grid,
.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.status-tile {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.status-good {
  color: var(--success);
  font-weight: 800;
}

.status-risk {
  color: var(--warning);
  font-weight: 800;
}

.settings-list {
  display: grid;
  gap: 0.55rem;
  padding-left: 1.2rem;
  color: var(--text);
}

.settings-save-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(8px);
}

progress {
  width: 100%;
  height: 0.8rem;
  margin-bottom: 1rem;
  accent-color: var(--primary-start);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: var(--text-strong);
  color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .landing-hero {
    min-height: 70vh;
  }

  .wallet-education-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header-content {
    align-items: center;
    position: relative;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    align-self: center;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 1rem;
    z-index: 120;
    display: flex;
    width: min(86vw, 23rem);
    min-height: auto;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.85rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.4rem) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .site-nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .site-header.is-compact .site-nav.open {
    display: flex;
  }

  .site-header.is-compact .nav-actions,
  .site-header .nav-actions {
    position: static;
    display: flex;
    width: 100%;
    padding: 0.25rem 0 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
  }

  body.nav-open .site-header .nav-actions {
    transform: none;
  }

  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 105;
    pointer-events: none;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav-toggle {
    position: relative;
    z-index: 130;
  }

  .nav-link {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--card) 88%, var(--background));
  }

  .nav-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .nav-actions > * {
    flex: 1 1 12rem;
  }

  .session-pill {
    max-width: none;
    text-align: center;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 5rem;
    z-index: 80;
    display: flex;
    max-height: calc(100vh - 6rem);
    overflow: auto;
    transition: width 0.2s ease, max-height 0.2s ease;
  }

  .sidebar-collapse-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
  }

  .dashboard-sidebar.collapsed {
    width: 3.25rem;
    max-height: 3.25rem;
    overflow: hidden;
  }

  .dashboard-sidebar.collapsed .sidebar-section {
    display: none;
  }

  .course-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .task-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-priority-grid,
  .settings-status-grid,
  .settings-check-grid {
    grid-template-columns: 1fr;
  }

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

  .landing-hero-inner,
  .split-band,
  .telegram-hero {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 62vh;
  }

  .hero-slide {
    align-items: end;
    justify-items: center;
    padding: 4.75rem 1rem 4rem;
  }

  .hero-slide.align-left,
  .hero-slide.align-right {
    justify-items: center;
  }

  .hero-slide-panel {
    width: min(100%, 34rem);
    padding: 1rem;
  }

  .hero-slide-panel h1,
  .hero-slide-panel h2 {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .hero-carousel-arrow {
    top: auto;
    bottom: 1.05rem;
    width: 2.45rem;
    height: 2.45rem;
    font-size: 1.7rem;
    transform: none;
  }

  .hero-carousel-arrow:hover,
  .hero-carousel-arrow:focus-visible {
    transform: scale(1.04);
  }

  .hero-carousel-prev {
    left: 1rem;
  }

  .hero-carousel-next {
    right: 1rem;
  }

  .qr-grid {
    grid-template-columns: 1fr;
  }

  .qr-card p {
    min-height: 0;
  }

  .landing-logo-panel {
    order: -1;
  }

  .landing-logo-panel img {
    width: min(80vw, 22rem);
  }

  .landing-metrics,
  .feature-grid,
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wallet-education-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-education-steps {
    grid-template-columns: 1fr;
  }

  .site-main {
    padding-bottom: 5.75rem;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .mock-panel,
  .section-heading {
    padding: 0 1rem;
  }

  .tab-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .assessment-option-grid,
  .matching-pair-grid {
    grid-template-columns: 1fr;
  }

  .course-builder-form {
    gap: 1rem;
  }

  .course-builder-form .card,
  .assessment-builder,
  .funding-card {
    padding: 1rem;
    border-radius: 1rem;
  }

  .course-builder-form input,
  .course-builder-form select,
  .course-builder-form textarea {
    min-height: 3rem;
    font-size: 1rem;
  }

  .course-builder-form .button-row {
    position: sticky;
    bottom: 5.9rem;
    z-index: 50;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .settings-save-bar {
    justify-content: stretch;
  }

  .settings-save-bar .button-primary {
    width: 100%;
  }

  .brand-with-logo span {
    font-size: 1.15rem;
  }

  .brand-with-logo img {
    width: 2rem;
    height: 2rem;
  }

  .landing-hero {
    min-height: 55vh;
    padding: 0;
  }

  .landing-copy h1 {
    font-size: clamp(2.2rem, 14vw, 3.35rem);
  }

  .hero-ctas {
    align-items: stretch;
  }

  .hero-ctas > * {
    flex: 1 1 100%;
    text-align: center;
  }

  .landing-section {
    padding: 2.5rem 1rem;
  }

  .telegram-landing {
    padding: 2rem 1rem;
  }

  .phone-mock {
    min-height: 0;
    border-radius: 1.5rem;
  }

  .telegram-screen {
    min-height: 520px;
  }

  .telegram-actions {
    grid-template-columns: 1fr;
  }

  .landing-metrics,
  .feature-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .landing-card,
  .landing-step,
  .landing-stat {
    min-height: 0;
  }

  .button-row > *,
  .table-actions > *,
  .course-footer > * {
    flex: 1 1 100%;
    width: 100%;
  }

  .responsive-table {
    min-width: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
  }

  .responsive-table td {
    padding: 0.45rem 0;
    border: 0;
  }
}
