:root {
  /* Mirror of React SPA Tailwind theme (client/src/index.css :root) — blue brand */
  --primary: #2563eb;          /* hsl(221 83% 53%) brand-primary */
  --primary-dark: #1d4ed8;     /* blue-700 — link/heading contrast */
  --primary-light: #93c5fd;    /* blue-300 — hover borders, gradient end */
  --bg: #ffffff;               /* hsl(0 0% 100%) */
  --bg-card: #ffffff;
  --accent: #eff4fe;           /* very light blue — table headers, hovers */
  --text: #323638;             /* hsl(200 5% 21%) */
  --text-light: #656c7b;       /* hsl(220 10% 44%) muted-foreground */
  --border: #e5e7eb;           /* hsl(220 13% 91%) */
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --max-width: 960px;
}

/* The SPA forces light even under prefers-color-scheme: dark (client/src/index.css
   .dark points at the same blue palette) so a system-dark user never falls back to
   the legacy magenta theme. theme-sync.js still adds html.dark, so mirror :root here. */
html.dark {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #93c5fd;
  --bg: #ffffff;
  --bg-card: #ffffff;
  --accent: #eff4fe;
  --text: #323638;
  --text-light: #656c7b;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* Header — matches the React landing page header (full-width, px-4 sm:px-6) */
.site-header {
  background: var(--bg);
  color: var(--text);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) {
  .site-header { padding: 0 1.5rem; }
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 64px;
}
.nav-bar .logo {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.125rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  letter-spacing: 0.05em;
}
.nav-bar .logo::before {
  content: '';
  display: inline-block;
  width: 4.5rem;
  height: 1.25rem;
  background: url('../_assets/zenoti-logo.svg') no-repeat center / contain;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .nav-bar .logo { font-size: 1.25rem; }
  .nav-bar .logo::before { width: 5rem; height: 1.5rem; }
}
.nav-bar .logo:hover { text-decoration: none; opacity: 0.8; }

/* Header right-side actions — matches React SPA ghost buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .header-actions { gap: 0.5rem; }
}

/* Ghost button base style (matches shadcn/ui Button variant="ghost" size="sm") */
.header-actions .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.25;
}
@media (min-width: 640px) {
  .header-actions .ghost-btn { padding: 0.375rem 0.75rem; }
}
.header-actions .ghost-btn:hover {
  background: var(--accent);
  text-decoration: none;
}
.header-actions .ghost-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.header-actions .ghost-btn .btn-label {
  display: none;
}
@media (min-width: 640px) {
  .header-actions .ghost-btn .btn-label { display: inline; }
}

/* User badge — avatar + name + chevron (matches ZenotiUserBadge) */
.header-actions .user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  cursor: default;
  font-size: 0.875rem;
  color: var(--text);
}
.header-actions .user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.header-actions .user-name {
  display: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
}
.header-actions .user-account {
  display: none;
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.2;
}
@media (min-width: 640px) {
  .header-actions .user-name { display: block; }
  .header-actions .user-account { display: block; }
}
.header-actions .user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.header-actions .chevron-icon {
  width: 1rem;
  height: 1rem;
  color: var(--text-light);
}

/* Dropdown menus — matches shadcn/ui DropdownMenuContent */
.header-dropdown {
  position: relative;
  display: inline-flex;
}
.header-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 14rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 0.25rem;
  animation: dropdown-in 0.12s ease-out;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.header-dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.dropdown-menu .dropdown-item:hover {
  background: var(--accent);
  text-decoration: none;
}
.dropdown-menu .dropdown-item.active {
  background: var(--accent);
}
.dropdown-menu .dropdown-item.destructive {
  color: #e40014;
}
html.dark .dropdown-menu .dropdown-item.destructive {
  color: #ff6b6b;
}
.dropdown-menu .dropdown-label {
  padding: 0.5rem 0.5rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}
.dropdown-menu .dropdown-label-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 400;
}
.dropdown-menu .dropdown-separator {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}
.dropdown-menu .dropdown-item .flag {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}
.dropdown-menu .dropdown-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Ask AI modal — search overlay matching SPA input style */
.ask-ai-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: overlay-in 0.15s ease-out;
}
.ask-ai-overlay.open {
  display: flex;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ask-ai-modal {
  width: 100%;
  max-width: 640px;
  margin: 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: modal-in 0.15s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ask-ai-modal .modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 0.75rem;
}
.ask-ai-modal .modal-header svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}
.ask-ai-modal .modal-header span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.ask-ai-modal .modal-body {
  padding: 0 1.25rem 1.25rem;
}
.ask-ai-modal .search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ask-ai-modal .search-input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.ask-ai-modal .search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.ask-ai-modal .search-input::placeholder {
  color: var(--text-light);
}
.ask-ai-modal .send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ask-ai-modal .send-btn:hover {
  opacity: 0.9;
}
.ask-ai-modal .send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ask-ai-modal .send-btn svg {
  width: 1rem;
  height: 1rem;
}
.ask-ai-modal .modal-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
}
.ask-ai-modal .modal-hint kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-light);
}

/* Page title + breadcrumb — inside the article card */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.breadcrumb {
  color: var(--text-light);
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Main */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.hero p { color: var(--text-light); font-size: 1.125rem; }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.category-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
}
.category-card h2 {
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
}
.category-card h2 a { color: var(--primary-dark); }
.category-card p { color: var(--text-light); font-size: 0.875rem; margin-bottom: 0.5rem; }
.category-card .count { font-size: 0.8rem; color: var(--text-light); }

/* Category Group (index page section heading) */
.category-group {
  grid-column: 1 / -1;
  margin-top: 1rem;
}
.category-group-title {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--primary-light);
}
.category-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Category Page */
.category-header { margin-bottom: 2rem; }
.category-header h1 { font-size: 1.75rem; color: var(--primary-dark); }
.category-description { color: var(--text-light); margin-top: 0.25rem; }

.section-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.section-tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
}
.section-tab:hover { color: var(--primary); }
.section-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}
a.section-tab { text-decoration: none; }

.article-list { display: flex; flex-direction: column; gap: 0.5rem; }
.article-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.article-item a { font-weight: 500; }
.article-item .meta { font-size: 0.8rem; color: var(--text-light); margin-left: auto; white-space: nowrap; }

.section-group { margin-bottom: 2rem; }
.section-group h2 {
  font-size: 1.125rem;
  color: var(--primary-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 0.75rem;
}

/* Article Page */
.help-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.help-content h1 { font-size: 1.75rem; color: var(--primary-dark); margin-bottom: 1rem; }
.help-content h2 { font-size: 1.375rem; color: var(--text); margin: 1.5rem 0 0.75rem; }
.help-content h3 { font-size: 1.125rem; color: var(--text); margin: 1.25rem 0 0.5rem; }
.help-content h4 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.help-content p { margin: 0.75rem 0; }
.help-content ul, .help-content ol { padding-left: 1.5rem; margin: 0.75rem 0; }
.help-content li { margin: 0.25rem 0; }
.table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  margin: 0;
}
.help-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.help-content th, .help-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.help-content th { background: var(--accent); font-weight: 600; }
.help-content code {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.875em;
}
.help-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}
.help-content pre code { background: none; padding: 0; color: inherit; }
.help-content blockquote {
  border-left: 3px solid var(--primary-light);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-light);
  background: #eff4fe;
  border-radius: 0 var(--radius) var(--radius) 0;
}
/* GLOBAL §148 admonition keyword classes: Action required (orange) /
   Breaking change (red) / Deprecated (gray). §159 V1 report disclaimer
   sentinel renders into a Deprecated blockquote (gray). */
.help-content blockquote.admonition-action-required {
  border-left-color: #d97706;
  background: #fffbeb;
}
.help-content blockquote.admonition-breaking-change {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.help-content blockquote.admonition-deprecated {
  border-left-color: #6b7280;
  background: #f3f4f6;
}
.help-content img {
  display: block;
  margin: 1rem auto;
  box-shadow: var(--shadow);
}
.help-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-meta {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Page Layout (sidebar + main) */
.page-layout {
  display: flex;
  max-width: none;
  margin: 0;
}
.page-layout .site-main {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 2rem 1.5rem 4rem 2rem;
  transition: padding-left 0.2s;
}

/* Sidebar collapsed state */
.page-layout.sidebar-collapsed .sidebar {
  width: 0;
  overflow: hidden;
  border-right: none;
  padding: 0;
}
.page-layout.sidebar-collapsed .site-main {
  padding-left: 1.5rem;
}
.page-layout.sidebar-collapsed .sidebar-collapse-btn {
  display: none;
}

/* Sidebar expand button — shown when sidebar is collapsed */
.sidebar-expand-btn {
  display: none;
  position: fixed;
  left: 0;
  top: 80px;
  z-index: 50;
  width: 1.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-card);
  color: var(--text-light);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, background 0.1s;
}
.sidebar-expand-btn:hover {
  background: var(--accent);
  color: var(--text);
}
.sidebar-expand-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}
.page-layout.sidebar-collapsed .sidebar-expand-btn {
  display: flex;
}

/* Sidebar collapse button — inside sidebar header */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}
.sidebar-collapse-btn:hover {
  background: var(--accent);
  color: var(--text);
}
.sidebar-collapse-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}
.sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  margin: 0.75rem 0.5rem 0.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: #404757;
}
.sidebar-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  text-decoration: none;
}
.sidebar-back-icon { font-size: 1rem; line-height: 1; }
.sidebar-category-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav { padding: 0.5rem 0 1.5rem; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Tree TOC — Level 1: Sections */
.toc-l1 {
  margin-bottom: 0.125rem;
}
.toc-l1 > summary {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  padding: 0.625rem 1rem 0.375rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.toc-l1 > summary::-webkit-details-marker { display: none; }
.toc-l1 > summary::before {
  content: '\25B6';
  font-size: 0.5rem;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.toc-l1[open] > summary::before {
  transform: rotate(90deg);
}
.toc-l1 > summary:hover { color: var(--primary-dark); }

/* Tree TOC — Groups (sub-level within a section) */
.toc-group { margin-bottom: 0.25rem; }
.toc-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 1rem 0.25rem 1.25rem;
}

/* Tree TOC — Level 2: Articles */
.toc-l2-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-l2-item > a {
  display: block;
  padding: 0.3125rem 1rem 0.3125rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.4;
  transition: background 0.1s, color 0.1s;
}
.toc-l2-item > a:hover {
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.04);
}
.toc-l2-item.active > a {
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .page-layout { flex-direction: column; }
  .sidebar { display: none; }
  .page-layout .site-main { padding: 2rem 1rem 4rem; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 1.5rem; }
  .category-grid { grid-template-columns: 1fr; }
  .help-content { padding: 1.25rem; }
  .nav-bar { gap: 0.75rem; }
  .breadcrumb { font-size: 0.75rem; }
}

/* Video Cards — inline Wistia video embeds */
.video-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.video-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}
.video-thumbnail {
  position: relative;
  width: 80px;
  height: 52px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-play-btn {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.video-card:hover .video-play-btn {
  transform: scale(1.1);
}
.video-play-btn svg {
  width: 12px;
  height: 12px;
  margin-left: 2px;
}
.video-duration {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 0 0.25rem;
  border-radius: 2px;
  line-height: 1.4;
}
.video-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.video-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.3;
}
.video-desc {
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Video Modal — popup player */
.video-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: overlay-in 0.15s ease-out;
}
.video-modal-overlay.open {
  display: flex;
}
.video-modal {
  width: 90vw;
  max-width: 900px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  animation: modal-in 0.15s ease-out;
  position: relative;
}
.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: #111;
  color: #fff;
}
.video-modal-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-modal-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.1s;
}
.video-modal-close:hover { color: #fff; }
.video-modal-body {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}
.video-modal-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
@media (max-width: 640px) {
  .video-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .video-thumbnail { width: 100%; height: 0; padding-top: 56.25%; }
  .video-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
  .video-card:hover .video-play-btn { transform: translate(-50%, -50%) scale(1.1); }
  .video-duration { bottom: 6px; right: 8px; }
  .video-modal { width: 95vw; }
}