:root {
  --brand: #0056ff;
  --brand-dark: #0046d4;
  --brand-light: #e8f0ff;
  --accent: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --nav-h: 72px;
  --bar-h: 44px;
  --sticky-top: 116px;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.cssws-course-page main { flex: 1; }

.cssws-container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
.cssws-narrow { max-width: 48rem; }
.cssws-page-pad { padding: 2rem 0 4rem; }
.cssws-text-center { text-align: center; }
.cssws-mt-xl { margin-top: 3rem; }
.cssws-muted { color: var(--gray-600); font-weight: 500; }
.cssws-bg-gray { background: var(--gray-50); }
.cssws-section { padding: 4rem 0; }
.cssws-section-title { font-size: 1.875rem; font-weight: 800; color: var(--gray-900); margin: 0 0 0.5rem; }
.cssws-section-sub { color: var(--gray-600); margin: 0 0 2rem; }

/* Navbar */
.cssws-navbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid var(--gray-100);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cssws-navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
}
.cssws-logo-link {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none; color: var(--gray-900);
}
.cssws-logo-img { border-radius: 50%; object-fit: cover; }
.cssws-logo-text { font-size: 1.05rem; font-weight: 600; }
.cssws-logo-text strong { color: var(--brand); }
.cssws-nav-desktop { display: none; align-items: center; gap: 0.25rem; }
.cssws-nav-desktop a {
  text-decoration: none; color: var(--gray-600);
  font-size: 0.875rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 9999px;
}
.cssws-nav-desktop a:hover { background: var(--brand-light); color: var(--brand); }
.cssws-nav-mobile { display: inline-block; }
@media (min-width: 768px) {
  .cssws-nav-desktop { display: flex; }
  .cssws-nav-mobile { display: none; }
}

.cssws-btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0,86,255,.25);
  border: none;
  cursor: pointer;
}
.cssws-btn-primary:hover { background: var(--brand-dark); }
.cssws-btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.cssws-btn-outline {
  display: inline-block;
  border: 2px solid var(--brand);
  color: var(--brand);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  text-decoration: none;
  margin-left: 0.75rem;
}
.cssws-btn-white {
  background: #fff; color: var(--brand);
  font-weight: 700; padding: 0.875rem 2rem;
  border-radius: 9999px; text-decoration: none;
  display: inline-block;
}

/* Hero */
.cssws-hero {
  background-color: #fff;
  background-image:
    radial-gradient(at 0% 0%, rgba(0,86,255,.08) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139,92,246,.06) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(20,184,166,.06) 0, transparent 50%);
  padding: 4rem 0;
}
.cssws-hero-grid {
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 1024px) {
  .cssws-hero-grid { grid-template-columns: 1fr 1fr; padding: 3rem 0; }
}
.cssws-hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid rgba(0,86,255,.3);
  background: #fff; padding: 0.5rem 1rem;
  border-radius: 9999px; font-size: 0.875rem; font-weight: 700;
}
.cssws-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981; position: relative;
}
.cssws-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.1;
  color: var(--gray-900); margin: 1.5rem 0 1rem;
}
.cssws-gradient-text {
  background: linear-gradient(90deg, var(--brand), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cssws-hero-lead { font-size: 1.125rem; color: var(--gray-600); line-height: 1.7; max-width: 36rem; }
.cssws-hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.cssws-hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.cssws-hero-stats > div {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: 1rem; padding: 1.25rem; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.cssws-hero-stats strong { display: block; font-size: 1.75rem; color: var(--brand); }
.cssws-hero-stats span { font-size: 0.75rem; color: var(--gray-600); }

/* Pain cards */
.cssws-pain-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.cssws-pain-card {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: 1rem; padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.cssws-pain-icon { font-size: 1.5rem; }
.cssws-pain-title { font-weight: 700; color: var(--gray-900); margin: 0.5rem 0; }
.cssws-pain-fix { font-size: 0.875rem; color: var(--gray-600); margin: 0; }

/* Subject cards */
.cssws-subject-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cssws-subject-grid-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cssws-subject-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: 1rem; padding: 1.5rem;
  transition: transform .3s, box-shadow .3s;
}
.cssws-subject-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,86,255,.12);
  border-color: rgba(0,86,255,.2);
}
.cssws-subject-icon { font-size: 2rem; }
.cssws-subject-card h3 { margin: 0.75rem 0 0.5rem; font-size: 1.125rem; color: var(--gray-900); }
.cssws-subject-card p { font-size: 0.875rem; color: var(--gray-600); margin: 0; }
.cssws-subject-marks {
  display: inline-block; margin-top: 1rem;
  background: var(--brand-light); color: var(--brand);
  font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.75rem; border-radius: 9999px;
}
.cssws-group-tag { font-size: 0.7rem; color: var(--gray-600); }
.cssws-group-heading { margin: 2rem 0 1rem; color: var(--brand); font-size: 1.25rem; }

.cssws-cta-band {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 4rem 0; text-align: center;
}
.cssws-cta-band h2 { font-size: 2rem; margin: 0 0 0.5rem; }
.cssws-cta-band p { opacity: .9; margin-bottom: 1.5rem; }

.cssws-page-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 3rem 0; text-align: center;
}
.cssws-page-hero h1 { font-size: 2.5rem; margin: 0; }
.cssws-page-hero p { opacity: .9; max-width: 40rem; margin: 1rem auto 0; }

/* Subject bar */
.cssws-subject-bar {
  position: sticky; top: var(--nav-h); z-index: 30;
  display: flex; background: #282a35; color: #fff;
  border-bottom: 1px solid #3d3f4a;
}
.cssws-subject-bar-all {
  flex-shrink: 0; border-right: 1px solid #4b5563;
  padding: 0 0.75rem; display: flex; align-items: center;
}
.cssws-subject-bar-all a {
  color: #d1d5db; font-size: 0.75rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.cssws-subject-bar-scroll {
  display: flex; overflow-x: auto; flex: 1;
}
.cssws-subject-tab {
  white-space: nowrap; padding: 0.75rem 1rem;
  font-size: 0.875rem; font-weight: 600;
  color: #e5e7eb; text-decoration: none;
}
.cssws-subject-tab-sm { font-size: 0.75rem; padding: 0.75rem 0.75rem; }
.cssws-subject-tab:hover { background: #374151; color: #fff; }
.cssws-subject-tab.is-active { background: var(--brand); color: #fff; }
.cssws-subject-divider { align-self: center; padding: 0 0.5rem; color: #6b7280; }
.cssws-subject-more {
  white-space: nowrap; padding: 0.75rem 1rem;
  font-size: 0.75rem; font-weight: 700;
  color: #7eb8ff; text-decoration: none;
}

/* Course layout */
.cssws-course-layout {
  display: flex; align-items: flex-start;
  min-height: calc(100vh - var(--sticky-top));
}
.cssws-sidebar-desktop {
  display: none;
  width: 16rem;
  flex-shrink: 0;
  position: sticky;
  top: var(--sticky-top);
  height: calc(100vh - var(--sticky-top));
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #e5e7eb;
  background: #f1f5f9;
}
@media (min-width: 1024px) {
  .cssws-sidebar-desktop { display: flex; }
  .cssws-outline-mobile-btn { display: none !important; }
}
.cssws-sidebar-header {
  flex-shrink: 0; border-bottom: 1px solid #e5e7eb;
  background: #fff; padding: 0.75rem;
}
.cssws-sidebar-title { font-size: 0.75rem; font-weight: 700; color: var(--brand); margin: 0; }
.cssws-sidebar-sub { font-size: 0.6875rem; color: var(--gray-600); margin: 0.25rem 0 0; }
.cssws-sidebar-nav {
  flex: 1; overflow-y: auto; padding: 0.5rem;
}
.cssws-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.cssws-sidebar-row { display: flex; align-items: stretch; }
.cssws-sidebar-toggle {
  width: 1.25rem; flex-shrink: 0; border: none; background: none;
  font-size: 0.625rem; color: var(--gray-600); cursor: pointer;
}
.cssws-sidebar-spacer { width: 1.25rem; flex-shrink: 0; }
.cssws-sidebar-link {
  flex: 1; display: block; margin-bottom: 2px;
  padding: 0.375rem 0.5rem; border-radius: 4px;
  font-size: 0.8125rem; line-height: 1.35;
  text-decoration: none; color: var(--gray-600);
}
.cssws-sidebar-link.is-active {
  background: var(--brand); color: #fff; font-weight: 600;
}
.cssws-sidebar-item.is-chapter > .cssws-sidebar-row .cssws-sidebar-link {
  font-weight: 600; color: var(--gray-800);
}
.cssws-sidebar-children { list-style: none; margin: 0; padding: 0; display: none; }
.cssws-sidebar-children.is-open { display: block; }

.cssws-lesson-main { flex: 1; min-width: 0; }
.cssws-lesson-inner { max-width: 48rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.cssws-breadcrumb {
  font-size: 0.8125rem; color: var(--gray-600); margin-bottom: 1.5rem;
}
.cssws-breadcrumb a { color: var(--brand); text-decoration: none; }
.cssws-lesson-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800; color: var(--gray-900); margin: 0.25rem 0;
}
.cssws-lesson-parent { font-size: 0.875rem; font-weight: 600; color: var(--brand); margin: 0; }
.cssws-badge {
  display: inline-block; background: var(--brand); color: #fff;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.75rem; border-radius: 9999px; margin-top: 0.75rem;
}
.cssws-topic-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 1.5rem 0;
}
.cssws-nav-prev, .cssws-nav-next {
  font-size: 0.875rem; font-weight: 600;
  color: var(--brand); text-decoration: none;
  padding: 0.5rem 1rem; border: 1px solid var(--brand-light);
  border-radius: 0.5rem; background: var(--brand-light);
}
.cssws-youtube-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  margin: 1.5rem 0; border-radius: 0.75rem; overflow: hidden;
  background: #000;
}
.cssws-youtube-wrap iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* Prose */
.cssws-prose h2 {
  margin: 2rem 0 1rem; font-size: 1.5rem; font-weight: 700;
  color: var(--gray-900); border-bottom: 1px solid var(--brand-light); padding-bottom: 0.5rem;
}
.cssws-prose h3 { margin: 1.5rem 0 0.75rem; font-size: 1.25rem; font-weight: 600; color: var(--brand); }
.cssws-prose p { margin: 0 0 1rem; line-height: 1.7; color: var(--gray-700); }
.cssws-prose ul, .cssws-prose ol { margin: 0 0 1rem 1.5rem; }
.cssws-prose blockquote, .cssws-tip {
  margin: 1.5rem 0; border-left: 4px solid var(--brand);
  background: var(--brand-light); padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
}

/* Mobile outline */
.cssws-outline-mobile-btn {
  position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 40;
  background: var(--brand); color: #fff; border: none;
  padding: 0.75rem 1rem; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,86,255,.4);
}
.cssws-outline-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 45;
}
.cssws-outline-overlay.is-open { display: block; }
@media (max-width: 1023px) {
  .cssws-sidebar-desktop.is-mobile-open {
    display: flex; position: fixed;
    left: 0; top: var(--sticky-top);
    z-index: 50; width: 20rem; max-width: 85vw;
    height: calc(100vh - var(--sticky-top));
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
}

/* Roadmap */
.cssws-roadmap-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 4rem 0;
}
.cssws-roadmap-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 2rem;
}
.cssws-roadmap-stats > div {
  background: rgba(255,255,255,.1); padding: 1rem 1.5rem; border-radius: 0.75rem;
}
.cssws-roadmap-stats strong { display: block; font-size: 1.5rem; }
.cssws-roadmap-stats span { font-size: 0.875rem; opacity: .8; }
.cssws-schedule-list { margin-top: 2rem; }
.cssws-schedule-block {
  display: flex; gap: 1rem; padding: 1rem;
  border-radius: 0.5rem; border-left: 4px solid; margin-bottom: 0.75rem;
}
.cssws-block-study { border-color: var(--brand); background: #eff6ff; }
.cssws-block-revision { border-color: #a855f7; background: #faf5ff; }
.cssws-block-break { border-color: #9ca3af; background: var(--gray-50); }
.cssws-block-meal { border-color: #f59e0b; background: #fffbeb; }
.cssws-block-sleep { border-color: #6366f1; background: #eef2ff; }
.cssws-block-planning { border-color: #14b8a6; background: #f0fdfa; }
.cssws-schedule-time { width: 6rem; flex-shrink: 0; }
.cssws-schedule-time span { font-size: 0.6875rem; display: inline-block; margin-top: 0.25rem; }
.cssws-month-card {
  border: 1px solid var(--gray-100); border-radius: 1rem;
  padding: 1.5rem; margin-bottom: 1rem;
}

/* About */
.cssws-about-grid {
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 768px) {
  .cssws-about-grid { grid-template-columns: 1fr 1fr; }
}
.cssws-about-photo img {
  width: 100%; max-width: 24rem; border-radius: 1.5rem;
  box-shadow: 0 25px 50px rgba(0,86,255,.15);
  border: 4px solid rgba(0,86,255,.2);
}
.cssws-quote {
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  padding: 1.25rem 1.5rem; border-radius: 0 1rem 1rem 0;
  font-weight: 600;
}
.cssws-about-list {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  list-style: none; padding: 0;
}
.cssws-about-list li::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* Footer */
.cssws-footer {
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  padding: 3rem 0 2rem;
  margin-top: auto;
}
.cssws-footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.cssws-footer-brand { font-weight: 800; color: var(--gray-900); margin: 0 0 0.5rem; }
.cssws-footer-desc { font-size: 0.875rem; color: var(--gray-600); margin: 0; }
.cssws-footer-heading { font-weight: 700; font-size: 0.875rem; margin: 0 0 0.75rem; }
.cssws-footer a {
  display: block; font-size: 0.875rem;
  color: var(--gray-600); text-decoration: none; margin-bottom: 0.35rem;
}
.cssws-footer a:hover { color: var(--brand); }
.cssws-footer-copy {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
  font-size: 0.8125rem; color: var(--gray-600); text-align: center;
}
