:root, [data-theme="slate-dark"] {
  --bg: #0b1120;
  --page-bg: #1e293b;
  --card-bg: #1e293b;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --link: #38bdf8;
  --link-hover: #7dd3fc;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-subtle: rgba(56, 189, 248, 0.15);
  --accent-border: rgba(56, 189, 248, 0.35);
  --sidebar-bg: #0f172a;
  --header-bg: rgba(11, 17, 32, 0.92);
  --table-head: #0f172a;
  --code-bg: #0f172a;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --accent-dot: #38bdf8;
  --badge-text: #000000;
}

[data-theme="clean-light"] {
  --bg: #f8fafc;
  --page-bg: #ffffff;
  --card-bg: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --link: #0284c7;
  --link-hover: #0369a1;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-subtle: rgba(2, 132, 199, 0.12);
  --accent-border: rgba(2, 132, 199, 0.3);
  --sidebar-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.95);
  --table-head: #f1f5f9;
  --code-bg: #f8fafc;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --accent-dot: #0284c7;
  --badge-text: #ffffff;
}

[data-theme="corporate-blue"] {
  --bg: #f1f5f9;
  --page-bg: #ffffff;
  --card-bg: #ffffff;
  --ink: #1e293b;
  --muted: #475569;
  --line: #cbd5e1;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.12);
  --accent-border: rgba(37, 99, 235, 0.3);
  --sidebar-bg: #f8fafc;
  --header-bg: rgba(255, 255, 255, 0.95);
  --table-head: #e2e8f0;
  --code-bg: #f1f5f9;
  --shadow: 0 10px 25px -5px rgba(30, 41, 59, 0.1);
  --accent-dot: #2563eb;
  --badge-text: #ffffff;
}

[data-theme="nordic-forest"] {
  --bg: #041712;
  --page-bg: #0b261e;
  --card-bg: #0b261e;
  --ink: #ecfdf5;
  --muted: #6ee7b7;
  --line: #134e3a;
  --link: #34d399;
  --link-hover: #a7f3d0;
  --accent: #34d399;
  --accent-hover: #a7f3d0;
  --accent-subtle: rgba(52, 211, 153, 0.15);
  --accent-border: rgba(52, 211, 153, 0.35);
  --sidebar-bg: #082019;
  --header-bg: rgba(4, 23, 18, 0.92);
  --table-head: #082019;
  --code-bg: #082019;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --accent-dot: #34d399;
  --badge-text: #000000;
}

[data-theme="cyber-cobalt"] {
  --bg: #070b1e;
  --page-bg: #101738;
  --card-bg: #101738;
  --ink: #e0e7ff;
  --muted: #a5b4fc;
  --line: #26336e;
  --link: #818cf8;
  --link-hover: #c7d2fe;
  --accent: #818cf8;
  --accent-hover: #c7d2fe;
  --accent-subtle: rgba(129, 140, 248, 0.15);
  --accent-border: rgba(129, 140, 248, 0.35);
  --sidebar-bg: #0c1331;
  --header-bg: rgba(7, 11, 30, 0.92);
  --table-head: #0c1331;
  --code-bg: #0c1331;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --accent-dot: #818cf8;
  --badge-text: #000000;
}

[data-theme="warm-editorial"] {
  --bg: #fbf8f2;
  --page-bg: #ffffff;
  --card-bg: #ffffff;
  --ink: #292524;
  --muted: #78716c;
  --line: #e7e2d7;
  --link: #b45309;
  --link-hover: #92400e;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-subtle: rgba(180, 83, 9, 0.12);
  --accent-border: rgba(180, 83, 9, 0.3);
  --sidebar-bg: #f6f1e7;
  --header-bg: rgba(251, 248, 242, 0.95);
  --table-head: #efe9dc;
  --code-bg: #f6f1e7;
  --shadow: 0 10px 25px -5px rgba(41, 37, 36, 0.08);
  --accent-dot: #b45309;
  --badge-text: #ffffff;
}

[data-theme="royal-twilight"] {
  --bg: #12071f;
  --page-bg: #200e38;
  --card-bg: #200e38;
  --ink: #faf5ff;
  --muted: #d8b4fe;
  --line: #3b1c66;
  --link: #c084fc;
  --link-hover: #e9d5ff;
  --accent: #c084fc;
  --accent-hover: #e9d5ff;
  --accent-subtle: rgba(192, 132, 252, 0.15);
  --accent-border: rgba(192, 132, 252, 0.35);
  --sidebar-bg: #190a2c;
  --header-bg: rgba(18, 7, 31, 0.92);
  --table-head: #190a2c;
  --code-bg: #190a2c;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --accent-dot: #c084fc;
  --badge-text: #000000;
}

[data-theme="obsidian-amber"] {
  --bg: #0f0f11;
  --page-bg: #1c1b1f;
  --card-bg: #1c1b1f;
  --ink: #fffbeb;
  --muted: #fde68a;
  --line: #3f3e46;
  --link: #f59e0b;
  --link-hover: #fde047;
  --accent: #f59e0b;
  --accent-hover: #fde047;
  --accent-subtle: rgba(245, 158, 11, 0.15);
  --accent-border: rgba(245, 158, 11, 0.35);
  --sidebar-bg: #151418;
  --header-bg: rgba(15, 15, 17, 0.92);
  --table-head: #151418;
  --code-bg: #151418;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --accent-dot: #f59e0b;
  --badge-text: #000000;
}

[data-theme="high-contrast"] {
  --bg: #000000;
  --page-bg: #0a0a0a;
  --card-bg: #0a0a0a;
  --ink: #ffffff;
  --muted: #e4e4e7;
  --line: #52525b;
  --link: #facc15;
  --link-hover: #fef08a;
  --accent: #facc15;
  --accent-hover: #fef08a;
  --accent-subtle: rgba(250, 204, 21, 0.2);
  --accent-border: rgba(250, 204, 21, 0.4);
  --sidebar-bg: #050505;
  --header-bg: #000000;
  --table-head: #18181b;
  --code-bg: #18181b;
  --shadow: 0 10px 30px -5px rgba(255, 255, 255, 0.15);
  --accent-dot: #facc15;
  --badge-text: #000000;
}

* { box-sizing: border-box; }
html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  transition: background-color 0.25s ease, color 0.25s ease;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg);
}

/* TOP STICKY HEADER (Matches prettypiece.png) */
.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s;
}
.brand-icon-box:hover {
  transform: scale(1.04);
}
.brand-text {
  min-width: 0;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-title a {
  color: inherit;
  text-decoration: none;
}
.badge-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.brand-subtitle {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
@media (min-width: 768px) {
  .brand-subtitle { max-width: 500px; }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* SEARCH WRAPPER */
.search-wrapper {
  position: relative;
  width: 180px;
}
@media (min-width: 640px) {
  .search-wrapper { width: 250px; }
}
@media (min-width: 1024px) {
  .search-wrapper { width: 300px; }
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#live-search-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: all 0.2s;
}
#live-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px;
}
.search-dropdown.hidden {
  display: none;
}
.search-result-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.search-result-item:hover {
  background: var(--accent-subtle);
}
.search-result-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
}
.search-result-snippet {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* THEME PICKER (Matches prettypiece.png) */
.theme-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.palette-icon {
  color: var(--accent);
}
.theme-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.theme-picker-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 34px 7px 12px;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.theme-picker-select:hover {
  border-color: var(--accent);
}
.theme-accent-indicator {
  position: absolute;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-dot);
  border: 1px solid rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* MAIN MULTI-COLUMN LAYOUT */
.site-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* LEFT SIDEBAR */
.sidebar-nav {
  width: 290px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.quick-link:hover {
  background: var(--card-bg);
  border-color: var(--line);
}
.quick-link.active {
  background: var(--accent);
  color: var(--badge-text);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-subtle);
}
.quick-icon {
  flex-shrink: 0;
}

.nav-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nav-section {
  display: flex;
  flex-direction: column;
}
.nav-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}
.nav-section-summary:hover {
  color: var(--ink);
}
.nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.nav-section[open] .nav-chevron {
  transform: rotate(180deg);
}
.nav-links-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding-left: 10px;
  margin-left: 8px;
  border-left: 2px solid var(--line);
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.15s;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--card-bg);
}
.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}
.active-arrow {
  color: var(--accent);
  margin-left: 6px;
  flex-shrink: 0;
}

/* CENTER MAIN CONTENT */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: 860px;
}
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.breadcrumb-home {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumb-home:hover {
  color: var(--accent);
}
.breadcrumb-separator {
  opacity: 0.6;
}
.breadcrumb-current {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ARTICLE CARD (Matches rounded-3xl modern paper) */
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
  transition: background-color 0.25s, border-color 0.25s;
}
.article-card h1 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.25;
}
.article-card h2 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin: 36px 0 14px;
}
.article-card h3 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
}
.article-card p {
  margin: 0 0 16px;
  color: var(--ink);
  opacity: 0.95;
  font-size: 14.5px;
  line-height: 1.7;
}
.article-card ul, .article-card ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.article-card li {
  margin-bottom: 6px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.article-card a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.article-card a:hover {
  color: var(--link-hover);
}

/* APPLICATION PATH BADGE */
.application-path {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 18px 0 24px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
.application-path strong {
  color: var(--ink);
}

/* TABLES */
.article-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0 28px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.article-card th, .article-card td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.article-card th {
  background: var(--table-head);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-card tr:last-child td {
  border-bottom: none;
}
.article-card tbody tr:hover td {
  background: var(--accent-subtle);
}

/* CODE & IMAGES */
.article-card code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  border: 1px solid var(--line);
  color: var(--ink);
}
.article-card pre {
  background: var(--code-bg);
  color: var(--ink);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.article-card pre code {
  background: transparent;
  border: none;
  padding: 0;
}
.article-card img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.article-card em {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

/* PAGINATION CARDS */
.pagination-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}
@media (min-width: 640px) {
  .pagination-cards { grid-template-columns: 1fr 1fr; }
}
.page-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.page-nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-subtle);
}
.page-nav-card.next {
  text-align: right;
  justify-content: flex-end;
}
.page-nav-sub {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}
.page-nav-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}
.card-nav-icon {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.page-nav-card:hover .card-nav-icon {
  color: var(--accent);
}
.page-nav-card:hover .card-nav-icon.prev-icon {
  transform: translateX(-3px);
}
.page-nav-card:hover .card-nav-icon.next-icon {
  transform: translateX(3px);
}

/* FOOTER */
.article-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.footer-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}
.footer-home-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* RIGHT TOC (ON THIS PAGE) */
.toc-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  display: none;
}
@media (min-width: 1200px) {
  .toc-sidebar { display: block; }
}
.on-page-nav {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.toc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}
.on-page-nav a {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
  transition: color 0.15s;
}
.on-page-nav a:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .sidebar-nav { display: none; }
  .site-container { padding: 16px 12px 40px; }
}

/* ==========================================================
   VIDEO TRAINING & WATCH CALLOUT STYLES
   ========================================================== */
.watch-this-lesson {
  margin: 1.5rem 0;
  padding: 1.1rem 1.35rem;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.watch-this-lesson:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}
.watch-this-lesson small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.watch-this-lesson small a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.watch-this-lesson small a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
.watch-this-lesson details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}
.watch-this-lesson details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.watch-this-lesson details summary:hover {
  color: var(--ink);
}
.watch-this-lesson details ul {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.watch-this-lesson details li a {
  font-size: 0.85rem;
  color: var(--link);
  text-decoration: none;
}
.watch-this-lesson details li a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* Video Player in Video Lessons */
.video-player-container {
  margin: 1.5rem 0 2rem 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #000;
}
.video-player-container video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  background: #000;
}

/* Video Lesson Cards Grid on index.html */
.video-lesson-group {
  margin: 2.25rem 0;
}
.video-lesson-group h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.video-lesson-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.video-lesson-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.video-lesson-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}
.video-lesson-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.video-lesson-card h3 a:hover {
  color: var(--accent);
}
.video-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.video-card-badge {
  background: var(--accent-subtle);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
}
.video-card-chapters {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  font-size: 0.8rem;
}
.video-card-chapters summary {
  cursor: pointer;
  color: var(--muted);
}
.video-card-chapters ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 0 0;
}
.video-card-chapters li a {
  color: var(--link);
  text-decoration: none;
}

/* Chapter step scrubber buttons */
.chapter-steps-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chapter-step-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.95rem;
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  transition: all 0.15s ease;
}
.chapter-step-item:hover {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.chapter-scrub-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
}
.chapter-scrub-btn:hover {
  color: var(--accent);
}
.chapter-time-badge {
  background: var(--line);
  color: var(--muted);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  font-family: monospace;
  font-size: 0.75rem;
}
.chapter-help-links {
  list-style: none;
  margin: 0.25rem 0 0 1.5rem;
  padding: 0;
  font-size: 0.82rem;
}
.chapter-help-links li a {
  color: var(--link);
  text-decoration: none;
}
.chapter-help-links li a:hover {
  text-decoration: underline;
}

/* Video Player responsive constraint */
video, .video-player-container video {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block !important;
  border-radius: 0.75rem;
  background: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin: 1.25rem 0;
  object-fit: contain;
}
