@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Cairo:wght@400;600;700;800;900&display=swap");

:root {
  --bg: #121212;
  --bg-soft: #0a0a0a;
  --card: #1e1e1e;
  --card-2: #121212;
  --text: #eaeaea;
  --muted: #888888;
  --border: #333333;
  --primary: #0062fd;
  --primary-2: #0052d9;
  --primary-3: #01a2fd;
  --accent: #6ed0ff;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 8px;
  --hero-bg: linear-gradient(135deg, #141d33, #0b1830);
  --hero-text: #ffffff;
  --hero-sub: #a8b8d8;
  --topbar-bg: rgba(16,22,38,.9);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --card: #ffffff;
  --card-2: #f8fafc;
  --text: #1a212d;
  --muted: #5c6d85;
  --border: #e2e8f0;
  --primary: #0062fd;
  --primary-2: #0052d9;
  --primary-3: #01a2fd;
  --accent: #2e9fff;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(15,35,80,0.1);
  --radius: 8px;
  --hero-bg: linear-gradient(135deg, #f8fbff, #e8f2ff);
  --hero-text: #2f3943;
  --hero-sub: #5c6d85;
  --topbar-bg: rgba(255,255,255,0.9);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "DM Sans", "Cairo", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 14px;
  transition: background .2s, color .2s;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.brand { display: flex; align-items: center; cursor: pointer; }
.brand img { height: 34px; width: auto; display: block; background: #fff; border-radius: 6px; padding: 3px; }
:root[data-theme="dark"] .brand img { box-shadow: 0 0 0 1px var(--border); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a { padding: 8px 14px; border-radius: var(--radius); color: var(--muted); font-weight: 500; transition: .15s; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--card); }
.icon-btn.nav-toggle { display: none; background: transparent; border-color: transparent; color: var(--text); order: 2; }
.icon-btn.nav-toggle:hover { background: var(--card); border-color: var(--border); }
.account { display: flex; gap: 8px; align-items: center; }
.user-avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

.view { padding: 24px; max-width: 1280px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.row.end { justify-content: flex-end; }
.gap { gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: .15s;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: var(--bg-soft); border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label { display: block; margin-bottom: 14px; font-weight: 500; color: var(--muted); font-size: 13px; }
label > span, label > input, label > select, label > textarea { margin-top: 6px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.h1 { font-size: 32px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.5px; }
.h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }

.hero {
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  color: var(--hero-text);
  transition: background .2s;
}
.hero h1 { font-size: 40px; font-weight: 900; margin: 0 0 10px; letter-spacing: -1px; color: var(--hero-text); }
.hero p { color: var(--hero-sub); max-width: 640px; font-size: 16px; }

.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: .2s;
  cursor: pointer;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 12px 32px rgba(0,0,0,.15); }
.course-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--bg-soft), var(--card));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  color: var(--muted);
  background-size: cover; background-position: center;
}
.course-body { padding: 16px; }
.course-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; color: var(--text); }
.course-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.course-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.price { font-weight: 800; color: var(--primary-3); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(217,90,43,.12);
  color: var(--primary);
  border: 1px solid rgba(217,90,43,.25);
}
.badge.success { background: rgba(16,185,129,.12); color: var(--success); border-color: rgba(16,185,129,.25); }
.badge.warn { background: rgba(245,158,11,.12); color: var(--warn); border-color: rgba(245,158,11,.25); }

.sidebar {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.lesson-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: .15s;
}
.lesson-item:hover { background: var(--card); color: var(--text); }
.lesson-item.active { background: var(--primary); color: #fff; }
.lesson-item.done::before { content: ''; display: inline-block; width: 10px; height: 6px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(-45deg); margin-left: 6px; vertical-align: middle; }

.video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: var(--radius); background: #000;
  border: 1px solid var(--border);
}
.video-wrap iframe, .video-wrap video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: var(--radius); z-index: 100;
  box-shadow: var(--shadow); color: var(--text);
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 90;
  backdrop-filter: blur(4px);
}
.modal { width: min(560px, 92vw); max-height: 90vh; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.table tr:hover td { background: var(--bg-soft); }

.empty { text-align: center; padding: 48px; color: var(--muted); }

.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-card { max-width: 440px; margin: 40px auto; }

.progress-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); transition: width .3s; }

.rating { color: #fbbf24; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs button { background: transparent; border: 0; padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; transition: .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); }

.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.kpi .num { font-size: 28px; font-weight: 800; color: var(--primary-3); }
.kpi .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  margin: 4px;
  cursor: pointer;
  transition: .15s;
}
.tag:hover { border-color: var(--primary); color: var(--text); }
.tag.active { background: var(--primary); border-color: var(--primary); color: #fff; }

#themeToggle { font-size: 16px; }

/* Slim top loading bar (non-blocking route feedback) */
.route-loader {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, var(--primary), var(--primary-3), var(--primary));
  background-size: 200% 100%;
  animation: routeLoad 1s linear infinite;
}
.route-loader[hidden] { display: none; }
@keyframes routeLoad { to { background-position: -200% 0; } }

/* ===== Line icons ===== */
.ic { width: 16px; height: 16px; display: inline-block; flex-shrink: 0; vertical-align: -3px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 34px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 28px; height: 28px; }
.ic.sm { width: 13px; height: 13px; }
.star { color: var(--border); }
.star.filled { color: #f59e0b; fill: #f59e0b; }
.rating { display: inline-flex; gap: 2px; vertical-align: middle; }

/* ===== Brand hero & sections ===== */
.hero-platform { position: relative; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--primary); background: rgba(0,98,253,.1);
  border: 1px solid rgba(0,98,253,.25); border-radius: 999px;
  padding: 5px 12px; margin-bottom: 14px;
}
:root[data-theme="dark"] .hero-badge { color: var(--accent); background: rgba(1,162,253,.12); border-color: rgba(1,162,253,.3); }
.hero-platform h1 { max-width: 700px; }
.hero-platform p { max-width: 680px; line-height: 1.9; }

.section-block { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h1, .section-head h2 { margin: 0; }

.category-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; text-align: center; cursor: pointer; transition: .18s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.category-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.category-card .cat-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: var(--primary); background: linear-gradient(135deg, rgba(0,98,253,.12), rgba(1,162,253,.18));
}
.category-card strong { font-size: 14px; }

/* Continue learning */
.continue-card {
  margin-top: -12px; margin-bottom: 26px; border-radius: 12px; padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  box-shadow: var(--shadow);
}
.continue-label {
  color: #fff; font-size: 12px; font-weight: 700; padding: 8px 16px 4px;
}
.continue-inner {
  background: var(--card); border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.continue-thumb {
  width: 68px; height: 52px; flex: 0 0 68px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-soft), var(--card)); display: grid; place-items: center; font-size: 26px;
}
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.continue-info { flex: 1; min-width: 0; }
.continue-info h3 { margin: 0 0 3px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-info p { margin: 0 0 6px; }

/* ===== Wallet ===== */
.wallet-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: linear-gradient(135deg, rgba(0,98,253,.12), rgba(1,162,253,.16));
  border: 1px solid rgba(0,98,253,.3); color: var(--primary);
  font-weight: 800; font-size: 13px; padding: 7px 12px; border-radius: 999px;
  transition: .15s;
}
.wallet-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
:root[data-theme="dark"] .wallet-chip { color: var(--accent); }

.wallet-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.wallet-card {
  border-radius: 16px; padding: 22px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0062fd, #01a2fd);
  box-shadow: 0 12px 30px rgba(0,98,253,.28);
}
.wallet-card::after {
  content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.1); top: -70px; left: -50px;
}
.wallet-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .9; position: relative; }
.wallet-logo { font-weight: 900; font-size: 20px; background: rgba(255,255,255,.2); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.wallet-balance { font-size: 38px; font-weight: 900; margin: 18px 0 20px; position: relative; letter-spacing: -.5px; }
.wallet-balance small { font-size: 14px; font-weight: 600; opacity: .85; }
.wallet-topup { width: 100%; background: #fff; color: #0062fd; border-color: #fff; position: relative; }
.wallet-topup:hover { background: #eaf3ff; }

.package-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 10px; }
.package-btn {
  padding: 14px 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); cursor: pointer; font-weight: 700;
}
.package-btn:hover, .package-btn.selected { border-color: var(--primary); background: rgba(0,98,253,.1); color: var(--primary); }

.tx-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tx-row:last-child { border-bottom: none; }
.tx-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; flex: 0 0 34px; }
.tx-icon.in { background: rgba(16,185,129,.14); color: #10b981; }
.tx-icon.out { background: rgba(239,68,68,.12); color: #ef4444; }
.tx-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tx-info strong { font-size: 13px; }
.tx-amount { font-weight: 800; font-size: 14px; }
.tx-amount.in { color: #10b981; }
.tx-amount.out { color: #ef4444; }

/* ===== Tutor LMS-inspired template ===== */
.tut-breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-bottom: 16px;
}
.tut-breadcrumb a:hover { color: var(--primary); }
.tut-breadcrumb span:last-child { color: var(--text); font-weight: 600; }

.tut-page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.tut-page-head p { margin: 2px 0 0; }
.tut-result-count {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: rgba(0,98,253,.1); border: 1px solid rgba(0,98,253,.22);
  padding: 6px 12px; border-radius: 999px;
}

.tut-filter-bar {
  display: grid; grid-template-columns: 1fr 190px 170px auto; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.tut-search-wrap { position: relative; display: flex; align-items: center; }
.tut-search-wrap .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); }
.tut-search-wrap input { padding-inline-start: 38px; }
.tut-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tut-chip {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.tut-chip:hover { border-color: var(--primary); color: var(--text); }
.tut-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Course card */
.tut-course-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: .2s; display: flex; flex-direction: column;
}
.tut-course-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); }
.tut-course-media {
  height: 168px; position: relative; background: linear-gradient(135deg, rgba(0,98,253,.14), rgba(1,162,253,.2));
  background-size: cover; background-position: center; display: grid; place-items: center;
}
.tut-media-icon { color: var(--primary); opacity: .55; }
.tut-course-cat {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px;
}
.tut-course-flag {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  background: rgba(255,255,255,.92); color: #0062fd; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px;
}
.tut-course-body { padding: 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.tut-rating-line { display: inline-flex; align-items: center; gap: 6px; }
.tut-course-title { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 700; }
.tut-course-sub {
  margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tut-course-meta {
  display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px;
  padding-block: 8px; border-block: 1px solid var(--border);
}
.tut-course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tut-course-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.tut-instructor { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.tut-avatar {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
}
.tut-avatar.lg { width: 42px; height: 42px; flex-basis: 42px; font-size: 16px; }
.tut-avatar.xl { width: 64px; height: 64px; flex-basis: 64px; font-size: 24px; }
.tut-price { color: var(--primary); font-weight: 800; font-size: 15px; }

/* Single course */
.tut-course-hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; margin-bottom: 22px;
}
.tut-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tut-hero-sub { color: var(--muted); font-size: 15px; line-height: 1.8; margin: 0 0 16px; }
.tut-hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.tut-hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.tut-hero-author { display: flex; align-items: center; gap: 10px; }
.tut-hero-author strong { display: block; font-size: 14px; }
.tut-hero-media {
  min-height: 240px; border-radius: 10px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(0,98,253,.14), rgba(1,162,253,.22));
  background-size: cover; background-position: center; display: grid; place-items: center;
}
.tut-play-badge {
  width: 62px; height: 62px; border-radius: 50%; background: #fff; color: var(--primary);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.tut-play-badge .ic { width: 24px; height: 24px; margin-inline-start: 3px; }

.tut-course-layout {
  display: grid; grid-template-columns: 320px 1fr; grid-template-areas: "enroll main";
  gap: 20px; align-items: start;
}
.tut-course-main { grid-area: main; min-width: 0; }
.tut-enroll-wrap { grid-area: enroll; position: sticky; top: 90px; }
.tut-enroll-card {
  background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--primary);
  border-radius: 10px; padding: 22px; box-shadow: var(--shadow); text-align: center;
}
.tut-price-big { font-size: 34px; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.tut-includes { list-style: none; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--border); text-align: right; }
.tut-includes li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: var(--muted); }
.tut-includes .ic { color: var(--primary); }
.tut-wallet-note { margin-top: 14px; padding: 10px; border-radius: 6px; background: var(--bg-soft); font-size: 12px; color: var(--muted); }

.tut-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tut-tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 12px 18px; color: var(--muted); font-weight: 700; cursor: pointer; transition: .15s;
}
.tut-tabs button:hover { color: var(--text); }
.tut-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tut-tab-panel { display: none; }
.tut-tab-panel.active { display: block; }
.tut-learn-box { border-inline-start: 4px solid var(--primary); }
.tut-learn-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px 18px; margin-top: 14px; }
.tut-learn-grid > div { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.tut-learn-grid .ic { color: var(--success); margin-top: 2px; }
.tut-text-card { margin-top: 16px; }
.tut-prose { line-height: 1.9; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.tut-curriculum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tut-accordion { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.tut-accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; cursor: pointer; font-weight: 700; background: var(--bg-soft); list-style: none;
}
.tut-accordion summary::-webkit-details-marker { display: none; }
.tut-accordion[open] summary .ic { transform: rotate(180deg); }
.tut-accordion-body { padding: 8px; }
.tut-accordion .lesson-item { border-inline-start: 2px solid transparent; }
.tut-accordion .lesson-item.active { border-inline-start-color: var(--accent); }
.tut-lesson-name { flex: 1; }
.tut-instructor-card { display: flex; align-items: center; gap: 16px; }
.tut-review { padding: 14px 0; border-bottom: 1px solid var(--border); }

/* Lesson player */
.tut-learn-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.tut-lesson-title { margin: 4px 0 0; font-size: 24px; }
.tut-learn-progress { width: min(340px, 100%); }
.tut-learn-progress .muted { font-size: 12px; }
.tut-learn-layout {
  display: grid; grid-template-columns: 320px 1fr; grid-template-areas: "sidebar main";
  gap: 20px; align-items: start;
}
.tut-learn-main { grid-area: main; min-width: 0; }
.tut-learn-sidebar { grid-area: sidebar; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.tut-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tut-sidebar-curriculum { margin-top: 10px; max-height: 560px; overflow-y: auto; }
.tut-accordion.sm summary { padding: 10px 12px; font-size: 13px; }
.tut-accordion.sm .lesson-item { font-size: 12.5px; padding: 8px 10px; }
.tut-back-course { width: 100%; margin-top: 12px; }
.tut-lesson-card { padding: 0; overflow: hidden; }
.tut-lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Dashboard */
.tut-dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.tut-dash-sidebar {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
}
.tut-dash-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.tut-dash-user strong { display: block; font-size: 14px; }
.tut-dash-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 7px; color: var(--muted); font-weight: 600; transition: .15s;
}
.tut-dash-sidebar a:hover { background: var(--bg-soft); color: var(--text); }
.tut-dash-sidebar a.active { background: rgba(0,98,253,.12); color: var(--primary); }
.tut-dash-content { min-width: 0; }
.tut-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0 24px; }
.tut-stat { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.tut-stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(0,98,253,.12); color: var(--primary); }
.tut-stat-icon.success { background: rgba(16,185,129,.12); color: var(--success); }
.tut-stat-icon.warn { background: rgba(245,158,11,.12); color: var(--warn); }
.tut-stat .num { font-size: 24px; font-weight: 800; }
.tut-stat .label { color: var(--muted); font-size: 12px; }
.tut-my-course { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: .2s; }
.tut-my-course:hover { transform: translateY(-3px); border-color: var(--primary); }
.tut-my-course-thumb { height: 130px; display: grid; place-items: center; color: var(--primary); background: linear-gradient(135deg, rgba(0,98,253,.14), rgba(1,162,253,.2)); background-size: cover; background-position: center; }
.tut-my-course-body { padding: 14px; }
.tut-my-course-body h3 { margin: 8px 0 4px; font-size: 15px; }
.tut-my-course-body p { margin-bottom: 10px; }

/* ===== Responsive ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg, video, iframe, canvas { max-width: 100%; }
.card, .tut-course-card, .tut-course-main, .tut-learn-main, .tut-dash-content { min-width: 0; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .tut-course-hero { grid-template-columns: 1fr; }
  .tut-course-layout { grid-template-columns: 1fr; grid-template-areas: "enroll" "main"; }
  .tut-enroll-wrap { position: static; }
  .tut-learn-layout { grid-template-columns: 1fr; grid-template-areas: "main" "sidebar"; }
  .tut-filter-bar { grid-template-columns: 1fr 1fr; }
  .tut-dashboard { grid-template-columns: 1fr; }
  .tut-dash-sidebar { flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .tut-dash-user { flex: 1 1 100%; }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    gap: 8px; flex-wrap: wrap; min-height: 56px;
  }
  .brand { font-size: 18px; margin-inline-end: auto; }
  .brand img { height: 30px; }
  .icon-btn.nav-toggle { display: inline-grid; }
  .wallet-chip { padding: 6px 9px; font-size: 12px; }
  .nav {
    display: none; order: 10; flex-basis: 100%; flex-direction: column;
    align-items: stretch; width: 100%; padding-top: 10px; margin-top: 2px;
    border-top: 1px solid var(--border); overflow: visible;
  }
  body.nav-open .nav { display: flex; }
  .nav a { padding: 10px 12px; font-size: 14px; }
  .account { margin-inline-start: 0; flex-wrap: nowrap; justify-content: flex-end; }
  .user-name { display: none; }
  #profileBtn { display: none; }
  .view { padding: 16px; }
  .hero { padding: 30px 20px; margin-bottom: 20px; }
  .hero h1 { font-size: 28px; letter-spacing: -.5px; }
  .hero p { font-size: 14px; }
  .grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .card { padding: 16px; }
  .modal { width: 96vw; padding: 16px; max-height: 92vh; overflow-y: auto; }
  .table { font-size: 13px; display: block; overflow-x: auto; }
  .table th, .table td { padding: 8px 6px; white-space: nowrap; }
  .kpi { padding: 12px; }
  .kpi .num { font-size: 22px; }
  .h1 { font-size: 26px; }
  .h2 { font-size: 20px; }
  .article { max-width: 100%; }
  .article-header, .article-body, .article-footer { padding: 16px; }
  .article-title { font-size: 22px; }
  .lesson-text { padding: 16px; font-size: 15px; }
  .video-wrap { border-radius: 8px; }
  .sidebar { margin-bottom: 16px; }
  /* learn view stacks: sidebar above content */
  .view .grid[style*="280px"] { grid-template-columns: 1fr !important; }
  .row { gap: 8px; }
  .row input, .row select, .row .btn { flex: 1 1 100%; max-width: 100% !important; }
  .wallet-layout { grid-template-columns: 1fr; }
  .continue-inner { gap: 10px; flex-wrap: wrap; }
  .continue-inner .btn { flex: 1 1 100%; }
  .continue-thumb { width: 56px; flex-basis: 56px; height: 46px; }
  .section-block { margin-top: 22px; }
  .wallet-balance { font-size: 32px; }
  .tut-filter-bar { grid-template-columns: 1fr; }
  .tut-stat-grid { grid-template-columns: 1fr; }
  .tut-learn-grid { grid-template-columns: 1fr; }
  .tut-hero-media { min-height: 180px; }
  .tut-course-hero { padding: 20px; }
  .tut-lesson-title { font-size: 20px; }
  .tut-learn-nav, .tut-lesson-nav { gap: 8px; }
  .tut-course-card .tut-course-media { height: 150px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .course-card .course-thumb { height: 140px; font-size: 40px; }
  .course-body { padding: 12px; }
  .course-title { font-size: 14px; }
  .auth-card { margin: 20px auto; padding: 16px; }
  .tabs { flex-wrap: wrap; }
  .tabs button { padding: 9px 12px; font-size: 13px; }
  .modal-backdrop { padding: 8px; }
  .toast { left: 8px; right: 8px; }
  .user-name { max-width: 100px; }
  .topbar { gap: 6px; }
  .brand img { height: 27px; }
  .wallet-chip { padding: 5px 8px; }
  .hero { padding: 24px 16px; }
  .tut-course-hero { padding: 16px; gap: 16px; }
  .tut-course-meta { gap: 8px; font-size: 11.5px; }
  .tut-course-foot { flex-direction: column; align-items: flex-start; }
  .tut-tabs button { padding: 10px 12px; font-size: 13px; }
  .tut-lesson-nav .btn { flex: 1 1 calc(50% - 8px); }
  .tut-lesson-nav #focusModeBtn { flex-basis: 100%; order: 3; }
  .tut-sidebar-curriculum { max-height: 420px; }
  .tut-dash-sidebar { flex-wrap: nowrap; overflow-x: auto; }
  .tut-dash-user { display: none; }
  .tut-dash-sidebar a { white-space: nowrap; }
  .quiz-option { padding: 11px 12px; gap: 9px; }
  .quiz-option__text { font-size: 14px; }
}

@media (max-width: 360px) {
  #themeToggle { display: none; }
  .topbar { padding-inline: 10px; }
  .view { padding: 12px; }
  .hero h1 { font-size: 22px; }
  .tut-price-big { font-size: 28px; }
  .tut-lesson-title { font-size: 18px; }
  .tut-enroll-card, .tut-learn-sidebar, .card { padding: 14px; }
}

/* Touch-friendly tap targets */
@media (hover: none) {
  .btn, .lesson-item, .course-card, .nav a { cursor: pointer; }
  .btn { min-height: 44px; }
}

/* Quiz options */
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.quiz-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: .2s;
}
.quiz-option:hover { border-color: var(--primary); background: var(--bg-soft); }
.quiz-option input { display: none; }
.quiz-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft, rgba(217,90,43,.08));
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.quiz-option__letter {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  transition: .2s;
}
.quiz-option:has(input:checked) .quiz-option__letter {
  background: var(--primary);
  color: #fff;
}
.quiz-option__text { flex: 1; min-width: 0; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }

/* Article (blog post style - SEO Plus inspired) */
.article {
  max-width: 780px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.article-header { padding: 28px 32px 0; }
.article-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.2;
  color: var(--text);
}
.article-meta {
  display: flex; gap: 16px; color: var(--muted);
  font-size: 13px; margin-bottom: 20px; flex-wrap: wrap;
}
.article-meta span { display: flex; align-items: center; gap: 4px; }
.article-body {
  padding: 24px 32px 32px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}
.article-body p { margin: 0 0 18px; }
.article-body h2, .article-body h3 {
  font-family: 'Outfit', sans-serif;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-soft, rgba(217,90,43,.15));
  color: var(--text);
}
.article-body blockquote {
  border-right: 4px solid var(--primary);
  padding: 12px 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  color: var(--muted);
  font-style: italic;
  margin: 20px 0;
}
.article-body code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; }
.article-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.article-tag {
  font-size: 12px; padding: 4px 12px; border-radius: 100px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.article-author { display: flex; gap: 12px; align-items: center; }
.article-author-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-soft, rgba(217,90,43,.12));
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-weight: 700; font-size: 18px;
}

/* PDF viewer */
.pdf-viewer {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* Reading progress */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.reading-progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-3));
  transition: width .1s linear;
}

/* Interactive text lesson */
.lesson-text {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  box-shadow: var(--shadow);
}
.lesson-text p { margin: 0 0 16px; }
.lesson-text h2, .lesson-text h3 {
  font-family: 'Outfit', sans-serif;
  margin: 24px 0 12px;
  color: var(--text);
}
.lesson-text code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--primary-3);
  overflow-wrap: anywhere;
}
.lesson-text blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  color: var(--muted);
  font-style: italic;
  margin: 16px 0;
}
.lesson-text ul, .lesson-text ol { padding-left: 24px; margin: 0 0 16px; }
.lesson-text li { margin-bottom: 6px; }

/* Focus mode */
.focus-mode .sidebar, .focus-mode .tut-learn-sidebar { display: none; }
.focus-mode .grid,
.focus-mode .tut-learn-layout,
.focus-mode .tut-course-layout { grid-template-columns: 1fr !important; grid-template-areas: "main" !important; }
.focus-mode .tut-learn-main, .focus-mode .tut-course-main { grid-area: main; }
/* ===== Gradivity v2 (option B) ===== */
:root, :root[data-theme="light"] {
  --bg:#f6f8fc; --bg-soft:#eef2f9; --card:#fff; --card-2:#f6f8fc;
  --text:#0a1533; --muted:#5d6f8a; --border:#e3e9f3;
  --primary:#0a1533; --primary-2:#0b1d36; --primary-3:#01a2fd; --accent:#01a2fd;
  --shadow:0 10px 30px rgba(15,39,71,.10); --radius:14px;
  --topbar-bg:rgba(255,255,255,.92);
}
:root[data-theme="dark"] {
  --bg:#0b1424; --bg-soft:#08101d; --card:#13203a; --card-2:#0f1a30;
  --text:#eef3fb; --muted:#93a4c0; --border:#223454;
  --primary:#01a2fd; --primary-2:#0090e0; --primary-3:#6ed0ff; --accent:#6ed0ff;
  --shadow:0 10px 30px rgba(0,0,0,.4); --radius:14px; --topbar-bg:rgba(11,20,36,.92);
}
body { font-family:"Cairo","DM Sans",system-ui,sans-serif; font-size:15px; }
h1,h2,h3,.h2 { font-family:"Cairo",sans-serif; font-weight:800; }
.btn.primary { background:#01a2fd; border-color:#01a2fd; color:#fff; border-radius:12px; font-weight:700; box-shadow:0 6px 16px rgba(1,162,253,.3); }
.btn.primary:hover { background:#0090e0; }
.btn.ghost { border-radius:12px; }
.topbar { border-bottom:1px solid var(--border); box-shadow:0 2px 12px rgba(15,39,71,.05); }
:root[data-theme="light"] .brand img { background:none; }
.v2-hero { display:grid; grid-template-columns:1.1fr .9fr; gap:32px; align-items:center; padding:48px 40px; margin-bottom:28px; border-radius:24px; color:#fff; background:linear-gradient(135deg,#0a1533 0%,#173a6b 60%,#1f4c8c 100%); position:relative; overflow:hidden; }
.v2-hero::after { content:""; position:absolute; width:380px; height:380px; border-radius:50%; background:radial-gradient(circle,rgba(1,162,253,.35),transparent 70%); left:-80px; bottom:-120px; }
.v2-hero-text { position:relative; z-index:1; }
.v2-pill { display:inline-flex; gap:6px; align-items:center; padding:6px 14px; border-radius:99px; background:rgba(255,255,255,.12); font-size:13px; font-weight:700; color:#ffd2ae; }
.v2-hero h1 { font-size:46px; line-height:1.25; margin:16px 0 12px; color:#fff; }
.v2-hero h1 span { color:#38bdf8; }
.v2-hero p { color:#c9d6ee; font-size:17px; line-height:1.9; max-width:520px; margin:0; }
.v2-cta { display:flex; gap:12px; flex-wrap:wrap; margin-top:24px; }
.v2-btn { padding:13px 24px; font-size:16px; }
.v2-hero .btn.ghost { color:#fff; border-color:rgba(255,255,255,.4); background:transparent; }
.v2-stats { display:flex; gap:28px; margin-top:30px; }
.v2-stats div { display:flex; flex-direction:column; }
.v2-stats b { font-size:26px; color:#fff; font-weight:800; }
.v2-stats span { color:#9fb3d6; font-size:13px; }
.v2-hero-art { position:relative; z-index:1; display:flex; justify-content:center; }
.v2-phone { width:230px; height:420px; border-radius:34px; background:#0a1730; border:6px solid #223a63; padding:14px; box-shadow:0 30px 60px rgba(0,0,0,.4); transform:rotate(-4deg); }
.v2-screen { height:100%; border-radius:22px; background:linear-gradient(180deg,#1b3a6b,#0a1533); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px; padding:16px; }
.v2-play { width:70px; height:70px; border-radius:50%; background:#01a2fd; display:grid; place-items:center; color:#fff; box-shadow:0 8px 20px rgba(1,162,253,.5); }
.v2-play .ic { width:30px; height:30px; }
.v2-wave { display:flex; align-items:center; gap:4px; height:50px; }
.v2-wave i { width:5px; border-radius:3px; background:#8fb4ff; }
.v2-wave i:nth-child(odd){height:16px} .v2-wave i:nth-child(3n){height:38px} .v2-wave i:nth-child(4n){height:48px} .v2-wave i:nth-child(5n){height:24px}
.v2-line { color:#e6eefc; font-size:14px; direction:ltr; font-family:"DM Sans",sans-serif; }
.v2-bar { width:100%; height:6px; background:rgba(255,255,255,.15); border-radius:3px; }
.v2-bar span { display:block; width:40%; height:100%; background:#01a2fd; border-radius:3px; }
.v2-float { position:absolute; display:flex; gap:6px; align-items:center; background:#fff; color:#0a1533; padding:9px 14px; border-radius:12px; font-weight:700; font-size:13px; box-shadow:0 10px 24px rgba(0,0,0,.25); }
.v2-float .ic { color:#01a2fd; }
.v2-float.f1 { top:50px; right:0; } .v2-float.f2 { bottom:60px; left:0; }
.v2-features { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:36px; }
.v2-feat { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:22px; box-shadow:var(--shadow); }
.v2-feat span { width:46px; height:46px; display:grid; place-items:center; border-radius:12px; background:rgba(1,162,253,.12); color:#01a2fd; }
.v2-feat h3 { margin:14px 0 6px; font-size:17px; }
.v2-feat p { margin:0; color:var(--muted); font-size:14px; line-height:1.7; }
.section-block .h2 { font-size:26px; }
.tut-course-card { border-radius:18px; overflow:hidden; box-shadow:var(--shadow); border:1px solid var(--border); transition:transform .2s; }
.tut-course-card:hover { transform:translateY(-4px); }
.tut-course-media { background-image:linear-gradient(135deg,#0a1533,#2457a6) !important; }
.tut-course-media:not([style*="url"]) { background:linear-gradient(135deg,#0a1533,#2457a6) !important; }
.tut-course-cat { background:#01a2fd !important; color:#fff !important; border-radius:99px !important; }
.tut-price { color:#01a2fd !important; font-weight:800; }
.category-card { border-radius:16px; }
.v2-faq details { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px 20px; margin-bottom:10px; }
.v2-faq summary { cursor:pointer; font-weight:700; font-size:16px; }
.v2-faq p { color:var(--muted); margin:10px 0 0; line-height:1.8; }
.v2-footer { margin-top:56px; background:#0a1533; color:#c9d6ee; padding:36px 24px 18px; }
.v2-foot-in { max-width:1100px; margin:0 auto; display:flex; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.v2-foot-in img { height:38px; background:#fff; padding:4px 10px; border-radius:8px; }
.v2-foot-in nav { display:flex; gap:20px; align-items:center; }
.v2-foot-in a { color:#c9d6ee; text-decoration:none; font-weight:600; }
.v2-copy { max-width:1100px; margin:24px auto 0; padding-top:14px; border-top:1px solid rgba(255,255,255,.12); font-size:13px; color:#8da2c6; }
@media (max-width:820px) {
  .v2-hero { grid-template-columns:1fr; padding:30px 22px; border-radius:20px; }
  .v2-hero h1 { font-size:32px; }
  .v2-hero-art { order:-1; }
  .v2-phone { width:170px; height:310px; }
  .v2-float { font-size:11px; padding:7px 10px; }
  .v2-features { grid-template-columns:1fr 1fr; }
  .v2-btn { flex:1; text-align:center; }
}

.v2-stats b .ic{width:26px;height:26px;color:#38bdf8}

/* ===== premium v4 ===== */
:root, :root[data-theme="light"] { --bg:#fbfaff; --text:#0a1533; --muted:#636a85; --border:#e8e8f3; --shadow:0 20px 50px -20px rgba(40,30,120,.25); }
body { background:var(--bg); }
.topbar { background:rgba(255,255,255,.75) !important; backdrop-filter:blur(14px); border-bottom:1px solid rgba(14,19,48,.06); box-shadow:none; }
.nav a { font-weight:700; }
.btn.primary { background:linear-gradient(135deg,#0062fd,#1a8cff); border:0; box-shadow:0 10px 24px -8px rgba(0,98,253,.6); color:#fff; }
.btn.primary:hover { background:linear-gradient(135deg,#0052d9,#0a78f0); }
.p-hero { position:relative; display:grid; grid-template-columns:1.15fr .85fr; gap:20px; align-items:center; padding:64px 56px; border-radius:32px; overflow:hidden; background:#0a1533; color:#fff; margin-bottom:20px; }
.p-mesh { position:absolute; inset:0; background:radial-gradient(600px 400px at 85% 10%,rgba(143,91,255,.55),transparent 60%),radial-gradient(500px 400px at 10% 100%,rgba(1,162,253,.35),transparent 60%),radial-gradient(400px 300px at 50% 50%,rgba(40,120,255,.25),transparent 60%); }
.p-hero-in,.p-hero-art { position:relative; z-index:1; }
.p-pill { display:inline-flex; align-items:center; gap:8px; padding:7px 16px; border-radius:99px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.18); font-size:13px; font-weight:700; color:#d6e6ff; }
.p-pill i { width:8px; height:8px; border-radius:50%; background:#3ddc97; box-shadow:0 0 0 4px rgba(61,220,151,.25); }
.p-hero h1 { font-size:58px; line-height:1.2; margin:20px 0 16px; letter-spacing:-.5px; color:#fff; font-weight:900; }
.p-hero h1 span { background:linear-gradient(90deg,#7ad6ff,#01a2fd 50%,#6ed0ff); -webkit-background-clip:text; background-clip:text; color:transparent; }
.p-hero p { color:#bfc5e2; font-size:17px; line-height:1.9; max-width:540px; margin:0 0 26px; }
.p-search { display:flex; align-items:center; gap:8px; background:#fff; border-radius:18px; padding:8px 8px 8px 14px; max-width:560px; box-shadow:0 20px 40px -12px rgba(0,0,0,.5); }
.p-search span { color:#7a80a0; display:grid; padding:0 6px; }
.p-search input { flex:1; border:0; outline:0; background:transparent; font-size:16px; color:#0a1533; min-width:0; padding:10px 4px; }
.p-search .btn { padding:12px 26px; border-radius:13px; }
.p-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.p-chips a { padding:7px 16px; border-radius:99px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); color:#dfe3f7; font-size:13px; font-weight:700; text-decoration:none; }
.p-chips a:hover { background:rgba(255,255,255,.18); }
.p-hero-art { min-height:420px; }
.p-card { position:absolute; background:rgba(255,255,255,.96); color:#0a1533; border-radius:22px; box-shadow:0 30px 60px -20px rgba(0,0,0,.55); }
.p-main { width:290px; right:50px; top:20px; padding:14px; transform:rotate(2deg); }
.p-vid { height:150px; border-radius:14px; background:linear-gradient(135deg,#0062fd,#6ed0ff 60%,#38bdf8); display:grid; place-items:center; }
.p-vid span { width:56px; height:56px; border-radius:50%; background:rgba(255,255,255,.95); color:#0062fd; display:grid; place-items:center; box-shadow:0 10px 20px rgba(0,0,0,.2); }
.p-lines { margin:14px 0 12px; display:grid; gap:7px; }
.p-lines b { height:9px; border-radius:5px; background:#e8e8f3; } .p-lines b:last-child { width:62%; }
.p-prog { height:7px; border-radius:4px; background:#ececf7; } .p-prog span { display:block; width:68%; height:100%; border-radius:4px; background:linear-gradient(90deg,#0062fd,#01a2fd); }
.p-main small { display:block; margin-top:10px; color:#636a85; font-weight:700; font-size:12px; }
.p-badge { display:flex; align-items:center; gap:10px; padding:11px 16px; border-radius:16px; }
.p-badge em { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; font-style:normal; background:#e8f1ff; color:#0062fd; }
.p-badge b { display:block; font-size:14px; } .p-badge small { color:#636a85; font-size:12px; }
.b1 { left:0; top:70px; } .b2 { right:0; bottom:60px; } .b3 { left:40px; bottom:20px; }
.b2 em { background:#e3f8ee; color:#12a36b; } .b3 em { background:#e3f5ff; color:#01a2fd; }
.p-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:44px; }
.p-strip div { display:flex; align-items:center; gap:10px; justify-content:center; padding:16px; border-radius:16px; background:#fff; border:1px solid var(--border); font-weight:700; font-size:14px; }
.p-strip b { color:#0062fd; display:grid; }
.section-block .h2 { font-size:30px; font-weight:900; letter-spacing:-.3px; }
.tut-course-card { border-radius:22px; border:1px solid var(--border); background:#fff; box-shadow:0 10px 30px -18px rgba(40,30,120,.35); }
.tut-course-card:hover { transform:translateY(-6px); box-shadow:0 26px 50px -22px rgba(40,30,120,.45); }
.tut-course-media { background:radial-gradient(circle at 80% 20%,rgba(110,208,255,.7),transparent 45%),linear-gradient(135deg,#0a2a8f,#0062fd 60%,#3da5ff) !important; }
.tut-course-media:not([style*="url"]) { background:radial-gradient(circle at 80% 20%,rgba(110,208,255,.7),transparent 45%),linear-gradient(135deg,#0a2a8f,#0062fd 60%,#3da5ff) !important; }
.tut-media-icon { color:rgba(255,255,255,.9) !important; }
.tut-course-cat { background:rgba(255,255,255,.95) !important; color:#0062fd !important; font-weight:800; }
.tut-price { background:linear-gradient(90deg,#0062fd,#01a2fd); -webkit-background-clip:text; background-clip:text; color:transparent !important; }
.category-card { border-radius:20px; background:#fff; border:1px solid var(--border); }
.cat-icon { background:#e8f1ff !important; color:#0062fd !important; }
.p-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.p-step { background:#fff; border:1px solid var(--border); border-radius:22px; padding:28px; position:relative; box-shadow:0 10px 30px -20px rgba(40,30,120,.35); }
.p-step i { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; font-style:normal; font-weight:900; font-size:19px; color:#fff; background:linear-gradient(135deg,#0062fd,#01a2fd); }
.p-step h3 { margin:16px 0 6px; font-size:19px; } .p-step p { margin:0; color:var(--muted); line-height:1.8; }
.p-cta { display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; margin:44px 0 10px; padding:40px 48px; border-radius:28px; color:#fff; background:radial-gradient(500px 300px at 90% 0%,rgba(1,162,253,.5),transparent 60%),linear-gradient(135deg,#0a2a8f,#0062fd); }
.p-cta h2 { margin:0 0 6px; font-size:32px; font-weight:900; color:#fff; } .p-cta p { margin:0; color:#d6e6ff; }
.p-cta-btn { background:#fff; color:#0a2a8f; font-weight:800; padding:14px 32px; border-radius:14px; border:0; font-size:16px; cursor:pointer; }
.v2-faq details { border-radius:18px; background:#fff; }
.v2-footer { background:#0a1533; }
@media (max-width:820px) {
  .p-hero { grid-template-columns:1fr; padding:36px 22px 28px; border-radius:26px; }
  .p-hero h1 { font-size:38px; }
  .p-hero-art { min-height:300px; order:2; margin-top:10px; }
  .p-main { width:230px; right:50%; margin-right:-115px; top:10px; }
  .b1 { left:0; top:30px; } .b2 { right:0; bottom:20px; } .b3 { display:none; }
  .p-search { padding:6px 6px 6px 10px; } .p-search .btn { padding:11px 16px; }
  .p-strip { grid-template-columns:1fr 1fr; }
  .p-strip div { font-size:12px; padding:12px 8px; }
  .p-steps { grid-template-columns:1fr; }
  .p-cta { padding:28px 24px; }
}

/* ===== v6: smaller headings + compact mobile ===== */
.section-block .h2 { font-size:20px; font-weight:800; letter-spacing:0; }
.section-block { margin-top:26px; }
.section-head { margin-bottom:12px; }
.section-head .muted.small { font-size:12.5px; }
.p-cta h2 { font-size:24px; }
.p-how .p-step { padding:20px; }
.p-step h3 { font-size:16px; margin:12px 0 4px; }
@media (max-width:768px){
  .section-block { margin-top:16px; }
  .section-block .h2 { font-size:16.5px; }
  .section-head { margin-bottom:8px; }
  .section-head .muted.small { display:none; }
  .p-strip { grid-template-columns:repeat(2,1fr) !important; gap:8px; margin-bottom:14px; }
  .p-strip div { padding:10px 8px; font-size:12px; gap:6px; border-radius:12px; }
  /* swipe rows */
  #featuredGrid, #coursesGrid, #categoryGrid, .p-steps {
    display:flex !important; flex-wrap:nowrap; overflow-x:auto; gap:10px;
    scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
    margin-inline:-16px; padding:2px 16px 10px; scrollbar-width:none;
  }
  #featuredGrid::-webkit-scrollbar, #coursesGrid::-webkit-scrollbar, #categoryGrid::-webkit-scrollbar, .p-steps::-webkit-scrollbar { display:none; }
  #featuredGrid > *, #coursesGrid > * { flex:0 0 68%; max-width:68%; scroll-snap-align:start; }
  #featuredGrid .tut-course-media, #coursesGrid .tut-course-media { height:110px !important; }
  #categoryGrid > .category-card { flex:0 0 auto; flex-direction:row; padding:8px 14px 8px 10px; gap:8px; border-radius:99px; scroll-snap-align:start; }
  #categoryGrid .cat-icon { width:30px; height:30px; border-radius:50%; }
  #categoryGrid .cat-icon svg { width:16px; height:16px; }
  #categoryGrid .category-card strong { font-size:13px; white-space:nowrap; }
  #categoryGrid .category-card .muted, #categoryGrid .category-card small { display:none; }
  .p-steps > .p-step { flex:0 0 72%; scroll-snap-align:start; padding:16px; border-radius:16px; }
  .p-step p { font-size:13px; line-height:1.6; }
  .p-cta { margin:22px 0 6px; padding:20px 18px; border-radius:20px; gap:12px; }
  .p-cta h2 { font-size:19px; } .p-cta p { font-size:13px; }
  .p-cta-btn { padding:10px 22px; font-size:14px; width:100%; }
  .v2-faq summary { padding:12px 14px; font-size:14px; }
  .p-hero-art { display:none !important; }
  .p-hero { padding-bottom:22px; }
  .p-hero h1 { font-size:28px; line-height:1.3; }
  .p-hero p { font-size:14px; line-height:1.7; }
  .v2-faq details { padding:2px 4px; margin-bottom:8px; border-radius:14px; }
  .v2-faq p { margin:0 0 10px; font-size:13.5px; padding:0 14px; }
  .site-footer, footer { margin-top:20px; }
}

/* ===== v9: timed access, quiz gating, PDF, stats, mobile polish ===== */
.lesson-item.locked { opacity: .55; cursor: not-allowed; }
.lesson-item.locked .ic { color: var(--muted); }
.v9-expired { max-width: 520px; margin: 48px auto; text-align: center; padding: 28px 22px; }
.v9-expired .btn { margin-top: 12px; }
.v9-pdf { margin-top: 16px; }
.v9-pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v9-pdf-head strong { display: inline-flex; align-items: center; gap: 6px; }
.v9-pdf-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
#pdfFrame { margin-top: 12px; }
#pdfFrame .pdf-viewer { width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: 10px; }
.v9-verdict { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); }
.v9-verdict:empty { display: none; }
.v9-verdict.ok { border-color: var(--success); background: rgba(16,185,129,.10); }
.v9-verdict.no { border-color: var(--warn); background: rgba(245,158,11,.10); }
.v9-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; margin-top: 14px; }
.v9-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; font-size: 11px; color: var(--muted); }
.v9-bar i { display: block; width: 100%; max-width: 26px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--primary-3, var(--accent))); }
.v9-bar b { font-weight: 700; color: var(--text); font-size: 11px; }
.v9-stats .kpi .num { font-size: 26px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .btn { min-height: 42px; }
  .v9-bars { gap: 3px; height: 120px; }
  .v9-bar { font-size: 9px; }
  .v9-bar b { font-size: 9px; }
  .v9-pdf-head { flex-direction: column; align-items: stretch; }
  .v9-pdf-btns .btn { flex: 1; justify-content: center; text-align: center; }
  #pdfFrame .pdf-viewer { min-height: 340px; }
  .tut-lesson-nav { flex-wrap: wrap; gap: 8px; }
  .tut-lesson-nav .btn { flex: 1 1 45%; justify-content: center; }
  .quiz-option { padding: 12px; }
  .tabs { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs button { flex: 0 0 auto; }
  .tut-learn-layout { display: flex; flex-direction: column; }
  .tut-learn-sidebar { order: 2; }
  .tut-learn-top { gap: 12px; }
  #lessonNotes { font-size: 16px; }
}
@media (max-width: 768px) {
  #accountArea > .row { flex-wrap: nowrap; gap: 6px; align-items: center; }
  #accountArea .user-name { display: none; }
  #accountArea .icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  .grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.grid-4 .kpi { padding: 14px 12px; }
}
