/* ============================================================
   Ava ERP Training Portal — design system
   Aligned with AvaERP design.md v2.3 (dark-only, oklch tokens,
   amber accent, status palette) with intentional deviations for
   a video-first marketing/learning surface:
     - button heights 36 (sm) / 48 (lg) — lg for hero CTA
     - H1 marketing scale 32–56 px instead of 16 px page-title
     - airy layout instead of ERP density
   Research reference: docs/research-video-training-portal-2026.md
   ============================================================ */

:root {
  color-scheme: dark;

  /* Surfaces (design.md §2.1) */
  --background: oklch(0.15 0 0);
  --card: oklch(0.25 0 0);
  --sidebar: oklch(0.17 0 0);
  --popover: oklch(0.32 0 0);
  --muted: oklch(0.17 0 0);

  /* Text */
  --foreground: oklch(0.98 0 0);
  --muted-foreground: oklch(0.78 0 0);

  /* Accent (amber) */
  --accent: oklch(0.782 0.157 68.5);
  --accent-soft: oklch(0.3 0.05 72);
  --accent-foreground: oklch(0.15 0.015 255);

  /* Status palette (design.md §2.1 status tokens) */
  --status-ok: oklch(0.765 0.177 149.5);      /* #4ade80 */
  --status-warning: oklch(0.782 0.157 68.5);  /* #f5a623 */
  --status-critical: oklch(0.637 0.237 25.3); /* #ef4444 */
  --status-progress: oklch(0.623 0.214 259.1);/* #3b82f6 */
  --status-review: oklch(0.702 0.183 303.4);  /* #a78bfa */

  /* Legacy aliases */
  --success: var(--status-ok);
  --danger: var(--status-critical);

  /* Radii (design.md §4.3) */
  --radius-button: 10px;
  --radius-card: 12px;
  --radius-hero: 18px;
  --radius: var(--radius-card);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.18s;
  --t-med: 0.26s;

  /* Layout */
  --shell-max: 1440px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(circle at top, rgb(245 166 35 / 0.10), transparent 32%),
    linear-gradient(180deg, rgb(255 255 255 / 0.02), transparent 30%),
    var(--background);
  color: var(--foreground);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

img, svg { max-width: 100%; display: block; }

/* Monospace for numbers (design.md §3.1) */
.mono, .num, time, kbd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   A11y baseline (WCAG 2.2 AA)
   ============================================================ */

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--card);
  color: var(--foreground);
  border: 2px solid var(--accent);
  border-radius: var(--radius-button);
  font-weight: 700;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; outline: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

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

/* ============================================================
   Typography scale (marketing + content)
   ============================================================ */

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }

.page-title { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; font-weight: 800; }
.page-title--compact { font-size: clamp(26px, 3.2vw, 42px); }
.page-summary { margin: 0; max-width: 72ch; color: var(--muted-foreground); line-height: 1.55; font-size: 16px; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--muted-foreground);
}

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

/* ============================================================
   Animations (subset kept from legacy)
   ============================================================ */

@keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes reveal-right { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shell-glow { 0%,100% { opacity: .25; } 50% { opacity: .55; } }
@keyframes teamhub-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.staged-reveal { opacity: 0; animation: reveal-up 0.7s var(--ease) forwards; }
.slide-left { animation-name: reveal-left; }
.slide-right { animation-name: reveal-right; }
.rise { animation-name: reveal-up; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.18s; }
.delay-3 { animation-delay: 0.32s; }
.delay-4 { animation-delay: 0.46s; }
.delay-5 { animation-delay: 0.60s; }
.delay-6 { animation-delay: 0.74s; }

/* ============================================================
   Buttons — semantic system (design.md §6.2)
   5 variants × 2 sizes:
     .btn--sm  = 36px (dense UI — sidebar, filters, toolbar)
     .btn--lg  = 48px (hero CTA, primary learning actions)
   Research: 2026 research §3 recommends 50px for comfort zone.
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 36px;
  min-height: 36px;
  border: 1px solid rgb(255 255 255 / 0.15);
  background: transparent;
  color: var(--foreground);
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  touch-action: manipulation;
}
.btn:hover { background: rgb(255 255 255 / 0.05); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.btn--lg {
  height: 48px;
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
}

.btn--xl {
  height: 56px;
  min-height: 56px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 700;
}

/* Primary (amber) — main CTA */
.btn--primary {
  border-color: rgb(245 166 35 / 0.5);
  color: #f5a623;
  background: rgb(245 166 35 / 0.08);
}
.btn--primary:hover { background: rgb(245 166 35 / 0.16); border-color: rgb(245 166 35 / 0.7); }

/* Primary filled — для hero и максимального визуального приоритета */
.btn--primary-filled {
  border-color: rgb(245 166 35 / 0.8);
  background: linear-gradient(180deg, #f5a623, #e28e0e);
  color: #171717;
  font-weight: 700;
  box-shadow: 0 14px 32px rgb(245 166 35 / 0.18);
}
.btn--primary-filled:hover {
  background: linear-gradient(180deg, #ffbf4d, #f29a12);
  border-color: rgb(255 191 77 / 0.95);
  color: #171717;
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgb(245 166 35 / 0.24);
}

/* Success (green) */
.btn--success {
  border-color: rgb(74 222 128 / 0.5);
  color: #4ade80;
  background: rgb(74 222 128 / 0.08);
}
.btn--success:hover { background: rgb(74 222 128 / 0.14); }

/* Info (blue) */
.btn--info {
  border-color: rgb(59 130 246 / 0.5);
  color: #3b82f6;
  background: rgb(59 130 246 / 0.08);
}
.btn--info:hover { background: rgb(59 130 246 / 0.14); }

/* Outline — neutral secondary */
.btn--outline {
  border-color: rgb(255 255 255 / 0.15);
  color: var(--foreground);
  background: transparent;
}
.btn--outline:hover { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.25); }

/* Destructive */
.btn--destructive {
  border-color: rgb(239 68 68 / 0.5);
  color: #ef4444;
  background: rgb(239 68 68 / 0.08);
}
.btn--destructive:hover { background: rgb(239 68 68 / 0.14); }

/* Legacy class aliases so old templates don't break */
.btn-primary { composes: none; }
.btn-ghost, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 18px; height: 44px; border-radius: var(--radius-button);
  font-weight: 700; text-decoration: none; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast);
  border: 1px solid rgb(255 255 255 / 0.15);
}
.btn-primary {
  background: linear-gradient(180deg, #f5a623, #e28e0e);
  color: #171717; border-color: rgb(245 166 35 / 0.8);
}
.btn-ghost { background: rgb(255 255 255 / 0.04); color: var(--foreground); }
.btn-ghost:hover { background: rgb(255 255 255 / 0.08); }

/* Status pills (design.md §2.2) */
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-ready,
.status-ready_shell { background: rgb(74 222 128 / 0.15); color: #4ade80; }
.status-scaffold { background: rgb(245 166 35 / 0.15); color: #f5a623; }
.status-awaiting_upload { background: rgb(59 130 246 / 0.15); color: #3b82f6; }
.status-in_progress { background: rgb(59 130 246 / 0.15); color: #3b82f6; }
.status-completed { background: rgb(74 222 128 / 0.15); color: #4ade80; }
.status-review { background: rgb(167 139 250 / 0.15); color: #a78bfa; }

/* Badge (accent pill) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  background: rgb(245 166 35 / 0.14);
  color: #f5a623;
  border: 1px solid rgb(245 166 35 / 0.3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================
   App shell (sidebar + content + bottom-nav)
   ============================================================ */

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: var(--shell-max);
  width: 100%;
  margin-inline: auto;
}

.sidebar {
  border-right: 1px solid rgb(255 255 255 / 0.06);
  background: var(--sidebar);
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-backdrop { display: none; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 16px;
  min-height: 44px;
}
.sidebar-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -16px;
  padding: 0 16px;
}

.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--foreground);
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-inline-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.brand-inline-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgb(255 255 255 / 0.05);
}
.sidebar-section:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}
.sidebar-section-title {
  display: block;
  width: 100%;
  padding: 2px 6px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  background: transparent;
  border: 0;
  text-align: left;
}
.sidebar-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.02);
  border: 1px solid rgb(255 255 255 / 0.16);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.03) inset,
    0 8px 20px rgb(0 0 0 / 0.25);
}
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-button);
  border: 1px solid rgb(255 255 255 / 0.03);
  background: rgb(255 255 255 / 0.015);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.sidebar-item:hover {
  color: var(--foreground);
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.08);
  transform: translateX(1px);
}
.sidebar-item.active {
  color: var(--foreground);
  background: rgb(245 166 35 / 0.16);
  border-color: rgb(245 166 35 / 0.34);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05);
}
.sidebar-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: rgb(255 255 255 / 0.62);
}
.sidebar-item.active .sidebar-item-icon { color: #f5a623; }
.sidebar-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar collapse toggle */
.sidebar-collapse-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.04);
  color: rgb(255 255 255 / 0.7);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-collapse-toggle:hover { background: rgb(245 166 35 / 0.18); color: #f5a623; }
.sidebar-collapse-toggle__icon { display: none; align-items: center; justify-content: center; }
.sidebar-collapse-toggle__icon[data-icon-expanded] { display: inline-flex; }

/* Sidebar rail (collapsed) mode — logo, icon nav, and avatar are visible */
@media (min-width: 1024px) {
  body.sidebar-rail .page-shell { grid-template-columns: 76px 1fr; }
  body.sidebar-rail .sidebar { padding: 16px 10px 18px; }
  body.sidebar-rail .sidebar-header {
    justify-content: center;
    padding: 0 0 12px;
    min-height: 0;
  }
  body.sidebar-rail .brand-inline {
    justify-content: center;
    cursor: pointer;
  }
  body.sidebar-rail .brand-inline-label { display: none; }
  body.sidebar-rail .brand-inline-icon { width: 36px; height: 36px; }
  body.sidebar-rail .sidebar-collapse-toggle { display: none; }

  body.sidebar-rail .sidebar-section { margin-top: 10px; padding-top: 8px; }
  body.sidebar-rail .sidebar-section-title { display: none; }
  body.sidebar-rail .sidebar-list {
    padding: 4px;
    gap: 4px;
    background: transparent;
    border: 0;
  }
  body.sidebar-rail .sidebar-item {
    position: relative;
    justify-content: center;
    padding: 10px;
    gap: 0;
  }
  body.sidebar-rail .sidebar-item-label { display: none; }
  body.sidebar-rail .sidebar-progress {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
  }

  body.sidebar-rail .sidebar-footer { padding-top: 12px; }
  body.sidebar-rail .user-chip__btn {
    padding: 6px;
    gap: 0;
    justify-content: center;
  }
  body.sidebar-rail .user-chip__meta,
  body.sidebar-rail .user-chip__caret { display: none; }
  body.sidebar-rail .user-chip__menu {
    left: 100%;
    right: auto;
    bottom: 0;
    margin-left: 10px;
    min-width: 180px;
  }
}

.sidebar-progress {
  --progress-pct: 0;
  width: 10px; height: 10px;
  border-radius: 9999px;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.04);
  flex: 0 0 auto;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.sidebar-progress.is-progress {
  background: conic-gradient(#7dd3fc calc(var(--progress-pct) * 1%), rgb(255 255 255 / 0.06) 0);
  border-color: rgb(125 211 252 / 0.55);
}
.sidebar-progress.is-complete {
  background: #4ade80;
  border-color: #4ade80;
  box-shadow: 0 0 0 3px rgb(74 222 128 / 0.22);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  position: relative;
}
@media (max-width: 1024px) {
  .sidebar-footer {
    position: sticky;
    bottom: 0;
    background: var(--panel);
    padding: 12px 16px;
    margin: 0 -16px -16px;
    border-top: 1px solid rgb(255 255 255 / 0.08);
    z-index: 10;
  }
}

/* User chip */
.user-chip { position: relative; }
.user-chip__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.03);
  color: var(--foreground);
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.03) inset,
    0 8px 20px rgb(0 0 0 / 0.25);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.user-chip__btn:hover {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.14);
}
.user-chip__avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1a1105;
  background: linear-gradient(140deg, #f5a623 0%, #f7c46c 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 1px 2px rgb(0 0 0 / 0.35);
}
.user-chip__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.user-chip__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip__mail {
  font-size: 11px;
  color: rgb(255 255 255 / 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip__caret {
  flex: 0 0 auto;
  color: rgb(255 255 255 / 0.5);
  transition: transform var(--t-fast);
}
.user-chip[data-open="true"] .user-chip__caret { transform: rotate(180deg); }

.user-chip__menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgba(26, 26, 28, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 60;
}
.user-chip__menu[hidden] { display: none; }
.user-chip__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.user-chip__menu-item:hover {
  background: rgb(245 166 35 / 0.16);
  color: #f5a623;
}
.user-chip__menu-item svg { flex: 0 0 auto; }

/* Main content area */
.content {
  padding: 24px 28px 40px;
  display: grid;
  gap: 20px;
  align-content: start;
  width: 100%;
  min-width: 0;
}
#main { outline: none; }

.content-sections { display: grid; gap: 20px; }

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
  flex-wrap: wrap;
}
.topline-copy {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.topline-copy strong { color: var(--foreground); }
.topline-label {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}
.topline-sep { opacity: 0.4; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Mobile sidebar toggle (desktop hidden) */
.mobile-sidebar-toggle {
  display: none;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--radius-card);
  padding: 22px;
}
.card--soft {
  background: rgb(255 255 255 / 0.025);
}
.card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.card p { margin: 0; }
.card > * + * { margin-top: 10px; }

.module-copy { color: var(--muted-foreground); line-height: 1.6; }

.quick-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* Grids */
.hero-grid { display: grid; gap: 18px; grid-template-columns: 1.15fr 0.85fr; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.cards-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }

/* Metrics */
.metric-row { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric {
  padding: 14px 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.025);
}
.metric-label { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.metric-value { margin-top: 6px; font-size: 22px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   Login / Hero
   ============================================================ */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 20px;
  position: relative;
  isolation: isolate;
}
.login-shell--entry::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 16%, rgb(245 166 35 / 0.22), transparent 26%),
    radial-gradient(circle at 78% 14%, rgb(123 128 139 / 0.11), transparent 20%),
    linear-gradient(125deg, rgb(255 255 255 / 0.025), transparent 30%, rgb(255 255 255 / 0.02));
  animation: shell-glow 6s ease-in-out infinite;
}
.login-shell--entry::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0, rgb(255 255 255 / 0.025) 50%, transparent 100%),
    linear-gradient(180deg, transparent, rgb(255 255 255 / 0.02), transparent);
  mask-image: radial-gradient(circle at center, black 40%, transparent 88%);
  opacity: 0.7;
}

/* Minimal login card — centered, single column */
.login-minimal {
  width: min(420px, 100%);
  padding: 40px 32px;
  background: var(--card);
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: var(--radius-hero);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.4);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.login-minimal-logo-wrap {
  position: relative;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255, 0.16), rgba(255,255,255, 0.02) 45%, rgba(0,0,0, 0.25));
  box-shadow:
    0 12px 28px rgba(0,0,0, 0.55),
    0 2px 6px rgba(0,0,0, 0.35),
    inset 0 1px 0 rgba(255,255,255, 0.18);
}
.login-minimal-logo {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255, 0.2),
    inset 0 -2px 6px rgba(0,0,0, 0.45);
}
.login-minimal-footer {
  margin-top: 10px;
  padding-top: 14px;
  width: 100%;
  border-top: 1px solid rgb(255 255 255 / 0.06);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted-foreground);
  text-align: center;
}
.login-minimal-footer sup {
  font-size: 9px;
  margin-left: 2px;
  vertical-align: super;
}
.login-minimal-title {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.login-minimal-subtitle {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
}
.login-minimal .entry-loader {
  width: 100%;
  margin: 14px 0 6px;
}
.login-minimal .login-form {
  width: 100%;
  display: grid;
  gap: 14px;
  text-align: left;
  margin-top: 6px;
}
.login-minimal .alert { width: 100%; text-align: left; }

.login-minimal .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.login-minimal .input {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-button);
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(0 0 0 / 0.35);
  color: var(--foreground);
  font-size: 14px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.login-minimal .input::placeholder { color: rgb(255 255 255 / 0.35); }
.login-minimal .input:hover { border-color: rgb(255 255 255 / 0.24); }
.login-minimal .input:focus,
.login-minimal .input:focus-visible {
  outline: none;
  border-color: rgb(245 166 35 / 0.75);
  background: rgb(0 0 0 / 0.5);
  box-shadow: 0 0 0 3px rgb(245 166 35 / 0.18);
}

@media (max-width: 480px) {
  .login-minimal { padding: 32px 22px; }
  .login-minimal-title { font-size: 22px; }
  .login-minimal-logo { width: 48px; height: 48px; border-radius: 13px; }
  .login-minimal-logo-wrap { border-radius: 16px; }
}

.login-wrap {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 0;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.028), rgb(255 255 255 / 0.016)),
    var(--card);
  border: 1px solid rgb(255 255 255 / 0.09);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 34px 96px rgb(0 0 0 / 0.42);
  position: relative;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.05), transparent 16%),
    radial-gradient(circle at 16% 12%, rgb(245 166 35 / 0.10), transparent 28%);
}

.hero {
  padding: 48px 44px;
  display: grid;
  align-content: start;
  gap: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgb(245 166 35 / 0.14), transparent 34%),
    linear-gradient(180deg, rgb(255 255 255 / 0.034), transparent 42%);
  border-right: 1px solid rgb(255 255 255 / 0.06);
  position: relative;
}
.hero-kicker {
  margin-top: -4px;
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--foreground) 76%, transparent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 58px);
  font-weight: 800;
  line-height: 0.98;
  max-width: 11ch;
}
.hero p.lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted-foreground);
  max-width: 56ch;
}
.hero-points {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hero-point {
  padding: 16px 16px 15px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.16);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.025));
  font-size: 13px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  min-height: 126px;
}
.hero-point strong { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.hero-point .muted { font-size: 12px; line-height: 1.58; }
.hero-point-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid rgb(245 166 35 / 0.22);
  background: rgb(245 166 35 / 0.08);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.hero-logo-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgb(255 255 255 / 0.07);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.025));
}
.hero-logo { width: 64px; height: 64px; border-radius: var(--radius-card); flex: 0 0 auto; }
.hero-logo-copy { min-width: 0; }
.hero-logo-title { font-size: 15px; font-weight: 800; }
.hero-logo-meta { font-size: 12px; color: var(--muted-foreground); line-height: 1.45; }
.hero-status-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 9999px;
  background: rgb(74 222 128 / 0.12);
  border: 1px solid rgb(74 222 128 / 0.24);
  color: #8ff0ae;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.entry-loader {
  position: relative;
  width: 100%;
  height: 2px;
  margin: 4px 0 2px;
  border-radius: 9999px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.08);
}
.entry-loader-bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgb(245 166 35 / 0.35) 25%, rgb(245 166 35 / 0.95) 50%, rgb(245 166 35 / 0.35) 75%, transparent 100%);
  animation: teamhub-shimmer 1.8s linear infinite;
}

.hero-trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-trust-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.04);
  color: color-mix(in srgb, var(--foreground) 84%, transparent);
  font-size: 12px;
  font-weight: 600;
}

.login-card {
  padding: 48px 40px;
  display: grid;
  align-content: center;
  gap: 16px;
  position: relative;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.022), rgb(255 255 255 / 0.01)),
    rgb(18 18 20 / 0.4);
}
.login-card h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.04; }
.login-card-head { display: grid; gap: 10px; }
.login-card-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted-foreground);
}
.login-meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.login-meta-chip {
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.045);
  border: 1px solid rgb(255 255 255 / 0.075);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
}

.login-security-note {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgb(255 255 255 / 0.075);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0.02));
}
.login-security-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}
.login-security-note span {
  display: block;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.58;
}
.login-security-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid rgb(245 166 35 / 0.24);
  background: rgb(245 166 35 / 0.08);
}

.login-form { display: grid; gap: 16px; margin-top: 2px; }
.login-field { display: grid; gap: 8px; }
.label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.04);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input-shell:focus-within {
  border-color: rgb(245 166 35 / 0.48);
  background: rgb(255 255 255 / 0.05);
  box-shadow: 0 0 0 4px rgb(245 166 35 / 0.10);
}
.input-icon {
  position: absolute;
  left: 14px;
  display: inline-flex;
  color: color-mix(in srgb, var(--muted-foreground) 88%, transparent);
  pointer-events: none;
}
.input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 15px;
}
.input::placeholder { color: color-mix(in srgb, var(--muted-foreground) 74%, transparent); }
.input:focus { outline: none; }
.input--password { padding-right: 96px; }
.input-toggle {
  position: absolute;
  right: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.035);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.input-toggle:hover {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.18);
}
.field-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-foreground);
}
.login-actions { display: grid; gap: 10px; margin-top: 2px; }
.login-submit-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.55;
}
.login-help-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}
.login-help-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.07);
  background: rgb(255 255 255 / 0.03);
}
.login-help-item strong {
  font-size: 13px;
  font-weight: 700;
}
.login-help-item span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-button);
  background: rgb(239 68 68 / 0.12);
  color: #fda4af;
  border: 1px solid rgb(239 68 68 / 0.25);
  font-size: 13px;
}

/* ============================================================
   Module list page
   ============================================================ */

.module-shell-header { display: grid; gap: 10px; }
.shell-intro { display: grid; gap: 12px; }
.shell-intro--compact { gap: 8px; }

.module-rows { display: grid; gap: 10px; }
.module-row {
  display: grid;
  grid-template-columns: 44px 220px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.025);
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  position: relative;
}
.module-row:hover {
  transform: translateY(-2px);
  border-color: rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.04);
}
.module-row.is-active {
  border-color: rgb(245 166 35 / 0.35);
  background: rgb(245 166 35 / 0.08);
}
.module-row.is-locked { opacity: 0.72; }
.module-row-index {
  font-size: 12px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-weight: 500;
}
.module-row-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.module-row-summary {
  color: var(--muted-foreground);
  line-height: 1.5;
  font-size: 13px;
}
.module-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.module-row-progress-wrap {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 10px;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.06);
  overflow: hidden;
}
.module-row-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f5a623, #ffc766);
  transition: width 0.3s var(--ease);
}

.module-row-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
}

/* Scaffold (coming soon) shell */
.coming-soon {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px dashed rgb(255 255 255 / 0.2);
  border-radius: var(--radius-card);
  background: rgb(255 255 255 / 0.02);
  text-align: left;
}
.coming-soon-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-card);
  background: rgb(245 166 35 / 0.10);
  display: grid; place-items: center;
  color: var(--accent);
}
.coming-soon-goals { margin: 4px 0 0; padding-left: 20px; color: var(--muted-foreground); line-height: 1.6; }

/* ============================================================
   Module detail — tabs + video player + chapters + transcript
   ============================================================ */

.tabs-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
.tabbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
  padding-bottom: 10px;
}
.tab-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-button);
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.02);
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 13px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tab-link:hover { background: rgb(255 255 255 / 0.05); color: var(--foreground); }
.tab-link.active {
  color: #f5a623;
  background: rgb(245 166 35 / 0.10);
  border-color: rgb(245 166 35 / 0.3);
}

/* Video shell: stage + chapters panel */
.video-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.video-stage { display: grid; gap: 14px; min-width: 0; }
.video-stage-frame {
  position: relative;
  border-radius: var(--radius-hero);
  border: 1px solid rgb(255 255 255 / 0.08);
  background: #050608;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.3);
}
.video-stage-frame::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -1;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 20%, rgb(245 166 35 / 0.16), transparent 58%);
  filter: blur(28px);
  opacity: 0.95;
}

.video-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #050608;
}

/* Custom player controls bar (overlay) */
.player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  color: #fff;
}
.player-wrapper:focus { outline: none; }
.player-wrapper:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-hero);
}

.player-top-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0,0,0, 0.55);
  backdrop-filter: blur(8px);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255, 0.72);
  opacity: 0;
  transition: opacity var(--t-med);
  pointer-events: none;
}
.player-wrapper:hover .player-top-hint,
.player-wrapper:focus-within .player-top-hint { opacity: 1; }

.player-big-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(0,0,0, 0) 40%, rgba(0,0,0, 0.35) 100%);
  transition: opacity var(--t-med);
  z-index: 1;
}
.player-big-play[hidden] { display: none; }
.player-big-play-icon {
  width: 84px; height: 84px;
  border-radius: 9999px;
  background: rgba(245,166,35, 0.92);
  display: grid; place-items: center;
  color: #171717;
  box-shadow: 0 20px 60px rgba(0,0,0, 0.5);
  transition: transform var(--t-fast);
}
.player-big-play:hover .player-big-play-icon { transform: scale(1.05); }

.player-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px 16px;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0,0,0, 0) 0%, rgba(0,0,0, 0.7) 60%, rgba(0,0,0, 0.82) 100%);
  opacity: 1;
  transition: opacity var(--t-med);
  z-index: 2;
}
.player-wrapper.is-playing:not(:hover):not(:focus-within) .player-controls { opacity: 0; }

.player-scrubber {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.player-scrubber-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255,255,255, 0.18);
  overflow: visible;
}
.player-scrubber-buffered {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255, 0.28);
  border-radius: 9999px;
}
.player-scrubber-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #f5a623, #ffc766);
  border-radius: 9999px;
}
.player-scrubber-thumb {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0, 0.4);
  transform: translate(-50%, -50%);
  transition: transform var(--t-fast);
}
.player-scrubber:hover .player-scrubber-thumb,
.player-wrapper:focus-within .player-scrubber-thumb { transform: translate(-50%, -50%) scale(1.2); }
.player-scrubber-marker {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: rgba(255,255,255, 0.65);
  border-radius: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-row--right { margin-left: auto; }

.player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background var(--t-fast);
}
.player-btn:hover { background: rgba(255,255,255, 0.12); }
.player-btn[aria-pressed="true"] { background: rgba(245,166,35, 0.22); color: #f5a623; }

.player-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255,255,255, 0.88);
  padding: 0 6px;
  min-width: 96px;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-volume-slider {
  width: 72px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255,255,255, 0.18);
  position: relative;
  cursor: pointer;
}
.player-volume-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #fff;
  border-radius: 9999px;
}

.player-menu {
  position: absolute;
  bottom: 56px;
  right: 18px;
  min-width: 148px;
  padding: 8px;
  border-radius: var(--radius-card);
  background: rgba(22,22,24, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255, 0.08);
  display: none;
  z-index: 3;
}
.player-menu[aria-hidden="false"] { display: grid; gap: 2px; }
.player-menu-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255, 0.6);
  padding: 4px 8px 6px;
}
.player-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-button);
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.player-menu-item:hover { background: rgba(255,255,255, 0.08); }
.player-menu-item[aria-checked="true"] { color: #f5a623; }
.player-menu-item[aria-checked="true"]::after { content: "✓"; font-size: 12px; }

/* Chapter panel */
.chapter-panel { display: grid; gap: 12px; }
.chapter-panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-foreground); font-weight: 600; }
.chapter-list { display: grid; gap: 6px; }
.chapter-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-button);
  border: 1px solid rgb(255 255 255 / 0.06);
  background: rgb(255 255 255 / 0.02);
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  width: 100%;
}
.chapter-item:hover {
  border-color: rgb(245 166 35 / 0.28);
  background: rgb(245 166 35 / 0.06);
}
.chapter-item.is-active {
  border-color: rgb(245 166 35 / 0.45);
  background: rgb(245 166 35 / 0.1);
}
.chapter-time {
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.chapter-copy {
  color: var(--foreground);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
}

/* Transcript tab */
.transcript-shell {
  display: grid;
  gap: 14px;
}
.transcript-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-button);
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.04);
}
.transcript-search input {
  flex: 1;
  height: 36px;
  background: transparent;
  border: 0;
  color: var(--foreground);
  font-size: 14px;
}
.transcript-search input:focus { outline: none; }
.transcript-block {
  max-height: 520px;
  overflow: auto;
  padding-right: 8px;
  display: grid;
  gap: 10px;
}
.transcript-cue {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 8px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.transcript-cue:hover {
  background: rgb(245 166 35 / 0.08);
}
.transcript-cue.is-hidden { display: none; }
.transcript-cue.is-match { background: rgb(245 166 35 / 0.06); border-radius: 8px; }
.transcript-cue mark {
  background: rgb(245 166 35 / 0.35);
  color: #fff;
  padding: 1px 2px;
  border-radius: 2px;
}
.transcript-cue-ts {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  align-self: start;
  line-height: 1.6;
  pointer-events: none;
}
.transcript-cue-copy {
  pointer-events: none;
}

/* Conspect / notes */
.text-block h2 { font-size: 20px; margin: 8px 0 4px; }
.text-block h3 { font-size: 17px; margin: 8px 0 4px; }
.text-block h4 { font-size: 15px; margin: 6px 0 4px; }
.text-block p { margin: 0 0 10px; color: var(--muted-foreground); line-height: 1.7; }
.list-clean {
  margin: 0;
  padding-left: 20px;
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* Materials grid */
.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.material-tile {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.18);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0.02));
  transition: transform var(--t-fast), border-color var(--t-fast);
  min-height: 140px;
}
.material-tile:hover {
  transform: translateY(-2px);
  border-color: rgb(245 166 35 / 0.28);
}
.material-tile.is-pending { opacity: 0.86; }
.material-kicker {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}
.material-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.material-cta {
  color: var(--foreground);
  font-weight: 600;
  font-size: 13px;
}
.small-meta { font-size: 11px; color: var(--muted-foreground); }

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item {
  padding: 18px 20px;
}
.faq-item h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.faq-item p { margin: 0; color: var(--muted-foreground); }

/* Empty state */
.empty-state {
  min-height: 160px;
  border-radius: var(--radius-card);
  border: 1px dashed rgb(255 255 255 / 0.12);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted-foreground);
}

/* Next step CTA block */
.next-step-card { margin-top: 4px; }
.next-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 26px;
  border-radius: var(--radius-button);
  background: linear-gradient(180deg, #f5a623, #e28e0e);
  color: #171717;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgb(245 166 35 / 0.8);
  box-shadow: 0 22px 40px rgb(245 166 35 / 0.18);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.next-step-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 48px rgb(245 166 35 / 0.26);
}

/* Guide pages (welcome/navigation/glossary/support-faq) */
.guide-card { display: grid; gap: 14px; }
.guide-list { display: grid; gap: 12px; }
.guide-list-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.55;
}
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.glossary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.18);
  background: rgb(255 255 255 / 0.03);
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.55;
}
.glossary-card strong {
  color: var(--foreground);
  font-size: 15px;
  font-weight: 700;
}

.system-lane {
  padding: 12px 14px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(255 255 255 / 0.06);
  background: rgb(255 255 255 / 0.025);
}
.system-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-foreground);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Focus-mode (when video is playing) */
body.focus-mode .sidebar,
body.focus-mode .module-shell-header,
body.focus-mode .chapter-panel,
body.focus-mode .module-materials,
body.focus-mode .next-step-card {
  opacity: 0.18;
  transition: opacity var(--t-med);
}
body.focus-mode .video-stage { position: relative; z-index: 2; }
body.focus-mode .video-stage-frame { box-shadow: 0 32px 110px rgb(0 0 0 / 0.44); }

/* ============================================================
   Logout confirmation modal
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  animation: reveal-up 0.2s var(--ease);
}
.modal-backdrop[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--popover);
  border: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: 0 40px 80px rgb(0 0 0 / 0.5);
  display: grid;
  gap: 12px;
}
.modal-card h2 { font-size: 20px; font-weight: 700; margin: 0; }
.modal-card p { margin: 0; font-size: 14px; line-height: 1.55; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  flex-wrap: wrap;
}
.modal-actions .btn { min-height: 44px; }

/* Login modal in modal-backdrop context */
.modal-backdrop[data-login-modal] {
  background: rgb(0 0 0 / 0.85);
  backdrop-filter: blur(12px);
}
.modal-backdrop[data-login-modal] .login-minimal {
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}
.modal-backdrop[data-login-modal] .login-minimal-title {
  font-size: 20px !important;
}
.modal-backdrop[data-login-modal] .login-minimal-subtitle {
  font-size: 11px;
}
.modal-backdrop[data-login-modal] .login-minimal .input {
  font-size: 13px;
  height: 40px;
}
.login-actions {
  margin-top: 6px;
}

.modal-backdrop--welcome {
  background:
    radial-gradient(circle at top, rgb(245 166 35 / 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgb(94 234 212 / 0.12), transparent 26%),
    rgb(0 0 0 / 0.68);
  backdrop-filter: blur(10px);
}
.modal-card--welcome {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  padding: 30px 28px 28px;
  overflow: hidden;
  gap: 14px;
  border-color: rgb(245 166 35 / 0.32);
  background: #141414;
  box-shadow: 0 42px 90px rgb(0 0 0 / 0.6);
}
.modal-card--welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.08), transparent 36%);
}
.welcome-modal-title {
  position: relative;
  z-index: 1;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.04;
  max-width: 12ch;
}
.welcome-modal-copy,
.welcome-modal-note,
.modal-actions--welcome,
.modal-card--welcome .badge {
  position: relative;
  z-index: 1;
}
.welcome-modal-copy {
  max-width: 42ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--foreground);
}
.welcome-modal-note {
  max-width: 46ch;
  color: var(--muted-foreground);
}
.modal-actions--welcome {
  justify-content: flex-start;
  margin-top: 6px;
}
.welcome-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.welcome-confetti-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Animated glowing gradient border around the welcome card */
.modal-card--welcome {
  isolation: isolate;
}
.modal-card--welcome::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: calc(var(--radius-card) + 2px);
  background: conic-gradient(
    from 0deg,
    #f5a623,
    #ffd166,
    #5eead4,
    #8ab4ff,
    #f472b6,
    #f5a623
  );
  filter: blur(18px);
  opacity: 0.5;
  animation: welcome-border-spin 7s linear infinite;
}
@keyframes welcome-border-spin {
  to { transform: rotate(360deg); }
}

/* Shimmering gradient title */
.welcome-modal-title-shimmer {
  background: linear-gradient(90deg, #ffffff 0%, #f5a623 25%, #ffd166 45%, #ffffff 65%, #f5a623 85%, #ffffff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: welcome-title-shimmer 3.5s linear infinite;
  display: inline-block;
}
@keyframes welcome-title-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Bouncing welcome badge */
.welcome-badge {
  animation: welcome-badge-pop 0.6s var(--ease) 0.2s backwards, welcome-badge-float 3s ease-in-out 0.9s infinite;
  font-size: 12px;
  padding: 4px 12px;
  height: 28px;
}
@keyframes welcome-badge-pop {
  0% { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  70% { transform: scale(1.18) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes welcome-badge-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(-2deg); }
}

/* Pulsing CTA */
.welcome-cta {
  animation: welcome-cta-pulse 2.2s ease-in-out infinite;
  gap: 10px;
}
@keyframes welcome-cta-pulse {
  0%, 100% { box-shadow: 0 14px 32px rgb(245 166 35 / 0.18), 0 0 0 0 rgb(245 166 35 / 0.5); }
  50% { box-shadow: 0 18px 40px rgb(245 166 35 / 0.28), 0 0 0 12px rgb(245 166 35 / 0); }
}

/* Floating orbs behind the modal */
.welcome-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: welcome-orb-drift 9s ease-in-out infinite;
}
.welcome-orb--1 {
  width: 320px; height: 320px;
  top: 10%; left: 8%;
  background: radial-gradient(circle, rgb(245 166 35 / 0.6), transparent 70%);
}
.welcome-orb--2 {
  width: 280px; height: 280px;
  top: 55%; right: 12%;
  background: radial-gradient(circle, rgb(94 234 212 / 0.55), transparent 70%);
  animation-delay: -3s;
}
.welcome-orb--3 {
  width: 260px; height: 260px;
  bottom: 8%; left: 40%;
  background: radial-gradient(circle, rgb(244 114 182 / 0.5), transparent 70%);
  animation-delay: -6s;
}
@keyframes welcome-orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -32px) scale(1.12); }
  66% { transform: translate(-20px, 18px) scale(0.94); }
}

/* Twinkling sparkles inside the card */
.welcome-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-card);
  z-index: 0;
}
.welcome-sparkles span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255, 0.4) 40%, transparent 70%);
  border-radius: 9999px;
  opacity: 0;
  animation: sparkle-twinkle 3.6s ease-in-out infinite;
}
.welcome-sparkles span:nth-child(1) { top: 12%; left: 18%; animation-delay: 0s; }
.welcome-sparkles span:nth-child(2) { top: 22%; left: 82%; animation-delay: 0.6s; width: 4px; height: 4px; }
.welcome-sparkles span:nth-child(3) { top: 68%; left: 12%; animation-delay: 1.2s; width: 8px; height: 8px; }
.welcome-sparkles span:nth-child(4) { top: 78%; left: 74%; animation-delay: 1.8s; }
.welcome-sparkles span:nth-child(5) { top: 44%; left: 58%; animation-delay: 2.4s; width: 5px; height: 5px; }
.welcome-sparkles span:nth-child(6) { top: 8%;  left: 52%; animation-delay: 3.0s; }
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Inner glow on the welcome card — subtle, sits in corners only */
.welcome-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 92% 8%, rgb(245 166 35 / 0.22), transparent 34%),
              radial-gradient(circle at 8% 96%, rgb(94 234 212 / 0.14), transparent 32%);
  pointer-events: none;
  animation: welcome-glow-pulse 5s ease-in-out infinite;
  z-index: 0;
}
@keyframes welcome-glow-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-card--welcome::after,
  .welcome-modal-title-shimmer,
  .welcome-badge,
  .welcome-cta,
  .welcome-orb,
  .welcome-sparkles span,
  .welcome-glow { animation: none; }
  .modal-card--welcome::after { opacity: 0.3; }
}

/* ============================================================
   Responsive — tablet + mobile
   Break 1180 → single column grids
   Break 1024 → drawer sidebar + hamburger toggle (also on mobile)
   Break 768  → typography + player tighten
   ============================================================ */

@media (max-width: 1180px) {
  .cards-grid,
  .hero-grid,
  .glossary-grid,
  .material-grid,
  .metric-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .col-8, .col-7, .col-5, .col-4 { grid-column: span 1; }
  .video-shell { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .hero { border-right: 0; border-bottom: 1px solid rgb(255 255 255 / 0.06); }
  .hero-status-chip { justify-self: start; }
  .module-row {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
  }
  .module-row-summary {
    grid-column: 2 / -1;
  }
  .module-row-meta {
    grid-column: 2 / -1;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 1024px) {
  .page-shell { grid-template-columns: 1fr; }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-med);
    z-index: 39;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform var(--t-med), visibility var(--t-med);
    z-index: 40;
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.34);
  }
  body.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }

  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: fixed;
    top: 56px;
    right: 12px;
    z-index: 60;
    min-height: 44px;
    min-width: 44px;
    padding: 0 14px;
    border: 1px solid rgb(245 166 35 / 0.3);
    background: rgb(22 22 24 / 0.9);
    backdrop-filter: blur(12px);
    color: var(--foreground);
    border-radius: var(--radius-button);
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.3);
  }

  .content { padding: 4px 16px 24px; }
  .mobile-sidebar-toggle { position: fixed; top: 8px; right: 12px; margin: 0; }
  .topline { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .login-card, .hero { padding: 32px 24px; }
  .hero h1 { font-size: 36px; }
  .hero-points { grid-template-columns: 1fr 1fr; }
  .login-help-row { grid-template-columns: 1fr; }
  .video-stage-frame { border-radius: var(--radius-card); }
}

@media (max-width: 768px) {
  /* Mobile: drawer + hamburger (inherited from ≤1024px block).
     No bottom bar — all navigation goes through the hamburger drawer. */
  .content {
    padding: 4px 14px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  /* Typography scale down */
  .page-title { font-size: 28px; }
  .hero h1 { font-size: 30px; }
  .card h2 { font-size: 18px; }
  .card h3 { font-size: 15px; }
  .hero-logo-wrap { grid-template-columns: auto 1fr; }
  .hero-status-chip { grid-column: 1 / -1; }
  .hero-points { grid-template-columns: 1fr; }
  .hero-point { min-height: 0; }
  .hero-trust-row { gap: 8px; }
  .login-card h2 { font-size: 28px; }
  .login-security-note { grid-template-columns: 1fr; }
  .input-toggle { height: 36px; }

  /* Player controls adapt */
  .player-time { min-width: 80px; font-size: 11px; }
  .player-btn { width: 44px; height: 44px; min-width: 44px; }
  .player-volume { display: none; }
  .player-controls { padding: 12px 12px 14px; }
  .player-scrubber-track { height: 8px; }
  .player-big-play-icon { width: 64px; height: 64px; }

  .hero-grid, .cards-grid, .material-grid { gap: 12px; }
  .tabbar { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 12px; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab-link { flex: 0 0 auto; }
}

@media (max-width: 480px) {
  .hero, .login-card { padding: 28px 18px; }
  .hero h1 { font-size: 26px; }
  .hero-logo-wrap { grid-template-columns: 1fr; }
  .hero-logo { width: 56px; height: 56px; }
  .login-shell { padding: 18px 12px; }
  .input { height: 54px; font-size: 14px; }
  .input--password { padding-right: 88px; }
  .input-toggle { right: 6px; padding: 0 10px; }
  .content {
    padding: 62px 12px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Utility */
.flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===========================================================
   MVP series navigation: course progress, lesson goals,
   lesson nav row, sticky mini-player, auto-advance, resume
   =========================================================== */

.course-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(22, 22, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0 0 14px;
}
.course-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.course-progress__position {
  font-weight: 600;
  color: #f5f5f5;
  letter-spacing: 0.2px;
}
.course-progress__pct {
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
}
.course-progress__track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.course-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #f5a623, #ffc766);
  transition: width 0.35s ease;
}

.lesson-goals {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.18);
  border-radius: 14px;
}
.lesson-goals__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f5a623;
  margin-bottom: 10px;
}
.lesson-goals__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 18px;
}
.lesson-goals__list li {
  position: relative;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.45;
}
.lesson-goals__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5a623;
}

.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 18px;
}
.lesson-nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(22, 22, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  text-decoration: none;
  min-height: 72px;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.lesson-nav__item:hover {
  border-color: rgba(245, 166, 35, 0.5);
  background: rgba(245, 166, 35, 0.05);
}
.lesson-nav__item--next {
  flex-direction: row-reverse;
  text-align: right;
}
.lesson-nav__item--disabled {
  opacity: 0.32;
  pointer-events: none;
}
.lesson-nav__thumb {
  width: 72px;
  height: 44px;
  border-radius: 8px;
  background-color: #050608;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.lesson-nav__meta {
  flex: 1;
  min-width: 0;
}
.lesson-nav__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}
.lesson-nav__title {
  font-size: 15px;
  font-weight: 600;
  color: #f5f5f5;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.lesson-nav__duration {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}
.lesson-nav__arrow {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.14);
  color: #f5a623;
  flex-shrink: 0;
}

/* Sticky mini-player */
.video-stage-frame {
  position: relative;
}
.video-stage-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}
.video-stage-frame:has(.player-wrapper.is-pinned) .video-stage-placeholder {
  display: flex;
}

.player-pin-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: rgba(5, 6, 8, 0.72);
  color: #f5f5f5;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}
.player-wrapper.is-pinned .player-pin-expand {
  display: inline-flex;
}
.player-pin-expand:hover { background: rgba(245, 166, 35, 0.85); color: #050608; }

.player-wrapper.is-pinned {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 340px;
  height: 192px;
  z-index: 1000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #050608;
  animation: pinFadeIn 0.25s ease;
}
.player-wrapper.is-pinned .player-top-hint { display: none; }
.player-wrapper.is-pinned .video-player { width: 100%; height: 100%; object-fit: cover; }

@keyframes pinFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Auto-advance overlay */
.player-autoadvance {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(6px);
  z-index: 6;
  color: #f5f5f5;
}
.player-autoadvance[hidden] { display: none; }
.player-autoadvance__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}
.player-autoadvance__title {
  font-size: 22px;
  font-weight: 700;
  max-width: 80%;
}
.player-autoadvance__countdown {
  font-size: 14px;
  color: #f5a623;
  font-variant-numeric: tabular-nums;
}
.player-autoadvance__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.player-autoadvance__toggle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Resume card on welcome */
.resume-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.16), rgba(245, 166, 35, 0.04));
  border: 1px solid rgba(245, 166, 35, 0.32);
  margin-bottom: 16px;
}
.resume-card[hidden] { display: none; }
.resume-card__thumb {
  width: 112px;
  height: 68px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #050608;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.resume-card__body { flex: 1; min-width: 0; }
.resume-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f5a623;
  font-weight: 600;
  margin-bottom: 4px;
}
.resume-card__title {
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f5;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resume-card__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  max-width: 320px;
}
.resume-card__fill {
  height: 100%;
  background: linear-gradient(90deg, #f5a623, #ffc766);
  transition: width 0.35s ease;
}
.resume-card__pct {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}
.resume-card__cta {
  flex-shrink: 0;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .course-progress { padding: 10px 14px; }
  .course-progress__meta { font-size: 12px; flex-wrap: wrap; }
  .lesson-goals { padding: 12px 14px; }
  .lesson-goals__list { grid-template-columns: 1fr; gap: 8px; }
  .lesson-nav { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .lesson-nav__item { min-height: 64px; padding: 10px 12px; }
  .lesson-nav__item--next { flex-direction: row; text-align: left; }
  .lesson-nav__thumb { width: 56px; height: 36px; }
  .lesson-nav__title { font-size: 14px; }

  .player-wrapper.is-pinned {
    position: fixed;
    inset: 8px 8px auto 8px;
    right: 8px;
    bottom: auto;
    top: 8px;
    width: auto;
    height: 80px;
    border-radius: 12px;
  }
  .player-wrapper.is-pinned .player-controls { display: none; }
  .player-wrapper.is-pinned .video-player { width: 142px; height: 80px; object-fit: cover; }
  .player-wrapper.is-pinned .player-big-play { transform: scale(0.6); }

  .player-autoadvance__title { font-size: 16px; }

  .resume-card { flex-direction: column; align-items: stretch; text-align: left; padding: 14px 16px; }
  .resume-card__thumb { width: 100%; height: 120px; }
  .resume-card__cta { width: 100%; justify-content: center; }
}

/* ===========================================================
   Welcome hero — first impression block
   =========================================================== */

.welcome-hero {
  position: relative;
  padding: 40px 44px;
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(245, 166, 35, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(22, 22, 24, 0.85), rgba(12, 12, 14, 0.92));
  border: 1px solid rgba(245, 166, 35, 0.22);
  margin-bottom: 18px;
  max-width: 880px;
  overflow: visible;
}
.welcome-hero__spark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.welcome-hero__spark-dot {
  fill: #fff4d6;
  filter:
    drop-shadow(0 0 1px #f5a623)
    drop-shadow(0 0 3px rgba(245, 166, 35, 0.85))
    drop-shadow(0 0 8px rgba(245, 166, 35, 0.45));
}
@media (prefers-reduced-motion: reduce) {
  .welcome-hero__spark { display: none; }
}
.welcome-hero__brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.welcome-hero__logo {
  flex-shrink: 0;
}
.welcome-hero__logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 8px 32px rgba(245, 166, 35, 0.35)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(245, 166, 35, 0.02));
}
.welcome-hero__title {
  margin: 0;
}
.welcome-hero__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #f5a623;
  margin-bottom: 14px;
}
.welcome-hero__title {
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.4px;
}
.welcome-hero__lede {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 16px;
  max-width: 720px;
}
.welcome-hero__lede strong { color: #f5a623; font-weight: 700; }
.welcome-hero__body {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 14px;
  max-width: 720px;
}
.welcome-hero__signature {
  margin-top: 22px;
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
}

.welcome-start { max-width: 880px; }

@media (max-width: 768px) {
  .welcome-hero { padding: 26px 22px; }
  .welcome-hero__title { font-size: 30px; }
  .welcome-hero__lede { font-size: 16px; }
  .welcome-hero__body { font-size: 14px; }
}

/* ===========================================================
   Mobile showcase page (/portal/page/navigation)
   =========================================================== */

.mobile-showcase__hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 36px 36px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(245, 166, 35, 0.04) 60%, rgba(22, 22, 24, 0.6));
  border: 1px solid rgba(245, 166, 35, 0.32);
  margin-bottom: 22px;
}
.mobile-showcase__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: #f5a623;
  margin-bottom: 12px;
}
.mobile-showcase__hero h1 {
  font-size: 38px;
  line-height: 1.1;
  margin: 0 0 14px;
  color: #ffffff;
  letter-spacing: -0.5px;
}
.mobile-showcase__hero p {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  max-width: 640px;
  margin: 0 0 18px;
}
.mobile-showcase__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mobile-showcase__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.32);
  color: #ffd791;
  font-size: 12px;
  font-weight: 600;
}
.mobile-showcase__hero-art {
  width: 160px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: rgba(5, 6, 8, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5a623;
  flex-shrink: 0;
}

.mobile-showcase__promises {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.mobile-showcase__promise {
  padding: 22px 22px;
  background: rgba(22, 22, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
}
.mobile-showcase__promise-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(245, 166, 35, 0.16);
  color: #f5a623;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.mobile-showcase__promise h3 {
  font-size: 18px;
  margin: 0 0 8px;
  color: #ffffff;
}
.mobile-showcase__promise p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.mobile-showcase__section-head { margin-bottom: 14px; }
.mobile-showcase__section-head h2 {
  font-size: 22px;
  margin: 0 0 6px;
  color: #ffffff;
}

.mobile-showcase__gallery-section { margin-bottom: 28px; }
.mobile-showcase__gallery {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mobile-showcase__gallery::-webkit-scrollbar { height: 10px; }
.mobile-showcase__gallery::-webkit-scrollbar-thumb { background: rgba(245, 166, 35, 0.4); border-radius: 999px; }
.mobile-showcase__gallery::-webkit-scrollbar-track { background: transparent; }

.mobile-showcase__phone {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-showcase__phone-frame {
  background: #050608;
  border: 1px solid rgba(245, 166, 35, 0.28);
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}
.mobile-showcase__phone-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 2;
}
.mobile-showcase__phone-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}
.mobile-showcase__phone--portrait .mobile-showcase__phone-frame {
  width: 260px;
  aspect-ratio: 9 / 19.5;
}
.mobile-showcase__phone--landscape .mobile-showcase__phone-frame {
  width: 520px;
  aspect-ratio: 19.5 / 9;
}
.mobile-showcase__landscape-stack {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.mobile-showcase__phone figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 4px;
  max-width: 260px;
}
.mobile-showcase__phone--landscape figcaption { max-width: 520px; }
.mobile-showcase__phone figcaption strong { color: #ffffff; font-size: 14px; }

.mobile-showcase__pwa {
  padding: 26px 28px;
  border-radius: 20px;
  background: rgba(22, 22, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}
.mobile-showcase__pwa-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.mobile-showcase__pwa-header h2 { margin: 0 0 4px; font-size: 22px; color: #fff; }
.mobile-showcase__pwa-header p { margin: 0; }
.mobile-showcase__pwa-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(245, 166, 35, 0.18);
  color: #f5a623;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-showcase__pwa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mobile-showcase__pwa-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(5, 6, 8, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-showcase__pwa-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}
.mobile-showcase__pwa-card ol {
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.6;
}
.mobile-showcase__pwa-card ol li + li { margin-top: 4px; }

.mobile-showcase__cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.mobile-showcase__case {
  padding: 20px 22px;
  border-radius: 16px;
  background: rgba(22, 22, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-showcase__case h3 {
  margin: 0 0 6px;
  color: #f5a623;
  font-size: 15px;
}
.mobile-showcase__case p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.66);
}

.mobile-showcase__cta {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

@media (max-width: 768px) {
  .mobile-showcase__hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 22px;
  }
  .mobile-showcase__hero h1 { font-size: 26px; }
  .mobile-showcase__hero p { font-size: 14px; }
  .mobile-showcase__hero-art { width: 100px; height: 130px; align-self: flex-start; }
  .mobile-showcase__hero-art svg { width: 80px; height: 80px; }
  .mobile-showcase__promises { grid-template-columns: 1fr; gap: 12px; margin-bottom: 22px; }
  .mobile-showcase__promise { padding: 18px; }
  .mobile-showcase__pwa-grid { grid-template-columns: 1fr; }
  .mobile-showcase__cases { grid-template-columns: 1fr; }
  .mobile-showcase__phone--portrait .mobile-showcase__phone-frame { width: 220px; }
  .mobile-showcase__phone--landscape .mobile-showcase__phone-frame { width: 300px; }
  .mobile-showcase__section-head h2 { font-size: 18px; }
  /* Gallery: vertical stack, no horizontal scroll */
  .mobile-showcase__gallery {
    flex-direction: column;
    overflow-x: visible;
    align-items: center;
    gap: 28px;
  }
  .mobile-showcase__landscape-stack {
    width: 100%;
    align-items: center;
  }
  /* PWA section: smaller padding */
  .mobile-showcase__pwa { padding: 20px 18px; }
  .mobile-showcase__pwa-header { flex-direction: column; gap: 12px; }
  .mobile-showcase__pwa-header h2 { font-size: 18px; }
  .mobile-showcase__pwa-card { padding: 16px; }
  .mobile-showcase__pwa-card ol { font-size: 13px; padding-left: 18px; }
  /* Cases */
  .mobile-showcase__case { padding: 16px; }
  .mobile-showcase__case h3 { font-size: 14px; }
  .mobile-showcase__case p { font-size: 12px; }
}

@media (max-width: 480px) {
  .mobile-showcase__hero {
    padding: 18px 14px;
    border-radius: 16px;
  }
  .mobile-showcase__hero h1 { font-size: 20px; }
  .mobile-showcase__hero p { font-size: 13px; }
  .mobile-showcase__hero-art { width: 70px; height: 90px; }
  .mobile-showcase__hero-art svg { width: 50px; height: 50px; }
  .mobile-showcase__badges {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .mobile-showcase__badge {
    font-size: 11px;
    padding: 4px 10px;
  }
  /* Gallery spacing */
  .mobile-showcase__gallery { gap: 22px; }
  /* Phones: much narrower to fit viewport */
  .mobile-showcase__phone--portrait .mobile-showcase__phone-frame { 
    width: 160px; 
    border-radius: 20px;
    padding: 6px;
  }
  .mobile-showcase__phone--portrait .mobile-showcase__phone-frame img {
    border-radius: 16px;
  }
  .mobile-showcase__phone--landscape .mobile-showcase__phone-frame { 
    width: 180px; 
    border-radius: 20px;
    padding: 6px;
  }
  .mobile-showcase__phone--landscape .mobile-showcase__phone-frame img {
    border-radius: 16px;
  }
  .mobile-showcase__phone figcaption { max-width: 180px; font-size: 11px; }
  .mobile-showcase__phone--landscape figcaption { max-width: 180px; }
  .mobile-showcase__phone figcaption strong { font-size: 12px; }
  /* Section headers */
  .mobile-showcase__section-head h2 { font-size: 16px; }
  .mobile-showcase__section-head p { font-size: 12px; }
  /* PWA */
  .mobile-showcase__pwa { padding: 16px 14px; }
  .mobile-showcase__pwa-icon { width: 44px; height: 44px; }
  .mobile-showcase__pwa-platform { font-size: 14px; }
  /* Promises */
  .mobile-showcase__promise { padding: 14px; }
  .mobile-showcase__promise h3 { font-size: 15px; }
  .mobile-showcase__promise p { font-size: 12px; }
  /* CTA button */
  .mobile-showcase__cta .btn { width: 100%; justify-content: center; }
}

/* =========================================================
   Feedback widget
   ========================================================= */
.fb-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 48px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.fb-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.fb-fab:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.fb-fab-label { white-space: nowrap; }
@media (max-width: 720px) {
  .fb-fab {
    right: 16px;
    bottom: max(20px, env(safe-area-inset-bottom) + 16px);
    padding: 0 14px;
    height: 44px;
  }
  .fb-fab-label { display: none; }
}

.fb-modal[hidden] { display: none; }
.fb-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.fb-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: fb-rise 220ms var(--ease);
}
@keyframes fb-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.fb-header h2 { margin: 0; font-size: 18px; flex: 1; }
.fb-admin-link {
  font-size: 12px;
  color: var(--muted-foreground);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}
.fb-admin-link:hover { color: var(--accent); border-color: var(--accent); }
.fb-close {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.fb-close:hover { color: var(--foreground); }
.fb-hint {
  margin: 0 0 14px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.5;
}
.fb-kind {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.fb-kind label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted-foreground);
  transition: all var(--t-fast) var(--ease);
}
.fb-kind label:hover { color: var(--foreground); }
.fb-kind input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kind input:checked + span { color: var(--accent-foreground); }
.fb-kind label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-foreground);
}
.fb-textarea-wrap { position: relative; }
.fb-textarea-wrap textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px 52px 12px 14px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.fb-textarea-wrap textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.fb-mic {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.fb-mic:hover:not([disabled]) { color: var(--foreground); border-color: var(--accent); }
.fb-mic[disabled] { opacity: 0.4; cursor: not-allowed; }
.fb-mic.is-listening {
  background: var(--status-critical);
  color: #fff;
  border-color: var(--status-critical);
  animation: fb-pulse 1.4s var(--ease) infinite;
}
@keyframes fb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}
.fb-mic-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
  min-height: 16px;
}
.fb-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fb-status { font-size: 13px; color: var(--muted-foreground); }
.fb-status[data-kind="error"] { color: var(--status-critical); }
.fb-status[data-kind="success"] { color: var(--status-ok); }
.fb-submit {
  padding: 0 20px;
  height: 40px;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.fb-submit:hover { filter: brightness(1.08); }
.fb-submit:disabled { opacity: 0.6; cursor: wait; }
body.fb-open { overflow: hidden; }

/* ---------- Feedback admin ---------- */
.fb-admin { display: flex; flex-direction: column; gap: 16px; }
.fb-admin-search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fb-admin-search input[type="search"] {
  flex: 1 1 280px;
  height: 40px;
  padding: 0 14px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 14px;
}
.fb-admin-search input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fb-admin-chips--muted .fb-admin-chip { opacity: 0.75; font-size: 12px; }
.fb-admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
}
.fb-admin-chip:hover { color: var(--foreground); border-color: rgba(255, 255, 255, 0.15); }
.fb-admin-chip.is-active {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}
.fb-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fb-admin-row {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.fb-admin-row--issue { border-left-color: var(--status-critical); }
.fb-admin-row--idea { border-left-color: var(--status-progress); }
.fb-admin-row--thumbs_up { border-left-color: var(--status-ok); }
.fb-admin-row--thumbs_down { border-left-color: var(--status-critical); }
.fb-admin-row__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.fb-admin-kind {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--foreground);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.fb-admin-kind--issue { background: rgba(239, 68, 68, 0.15); color: var(--status-critical); }
.fb-admin-kind--idea { background: rgba(59, 130, 246, 0.15); color: var(--status-progress); }
.fb-admin-kind--thumbs_up { background: rgba(74, 222, 128, 0.15); color: var(--status-ok); }
.fb-admin-kind--thumbs_down { background: rgba(239, 68, 68, 0.15); color: var(--status-critical); }
.fb-admin-user { font-weight: 600; color: var(--foreground); }
.fb-admin-voice { font-size: 15px; }
.fb-admin-body {
  color: var(--foreground);
  line-height: 1.55;
  white-space: pre-wrap;
  font-size: 14px;
}
.fb-admin-foot {
  margin-top: 10px;
  font-size: 12px;
}
.fb-admin-foot a { color: var(--muted-foreground); }
.fb-admin-foot a:hover { color: var(--accent); }

/* ---------- Lesson toolbar (rating + notes) ---------- */
.lesson-toolbar {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 18px;
}
.lesson-rating {
  display: block;
}
.lesson-rating__prompt {
  display: block;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 10px;
}
.lesson-rating__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lesson-rating__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all var(--t-fast) var(--ease);
}
.lesson-rating__btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.lesson-rating__btn[data-rating="thumbs_up"].is-active {
  background: rgba(74, 222, 128, 0.18);
  color: var(--status-ok);
  border-color: var(--status-ok);
}
.lesson-rating__btn[data-rating="thumbs_down"].is-active {
  background: rgba(239, 68, 68, 0.18);
  color: var(--status-critical);
  border-color: var(--status-critical);
}
.lesson-rating__status {
  color: var(--muted-foreground);
  font-size: 13px;
}

.lesson-notes {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}
.lesson-notes__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.lesson-notes__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.lesson-notes__form textarea {
  width: 100%;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-button);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 52px;
}
.lesson-notes__form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lesson-notes__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lesson-notes__ts {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 10px;
  background: var(--muted);
  border-radius: 6px;
}
.lesson-notes__mic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.lesson-notes__mic:hover:not([disabled]) { color: var(--foreground); border-color: var(--accent); }
.lesson-notes__mic.is-listening {
  background: var(--status-critical);
  color: #fff;
  border-color: var(--status-critical);
  animation: fb-pulse 1.4s var(--ease) infinite;
}
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.lesson-notes__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--background);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-button);
}
.lesson-note__ts {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.lesson-note__ts:hover { filter: brightness(1.08); }
.lesson-note__text {
  flex: 1;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.lesson-note__del {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.lesson-note__del:hover { color: var(--status-critical); }

/* ---------- Notes aggregate page ---------- */
.notes-page { display: flex; flex-direction: column; gap: 20px; }
.notes-page__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.notes-page__toolbar input[type="search"] {
  flex: 1 1 280px;
  height: 42px;
  padding: 0 14px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 14px;
}
.notes-page__toolbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.notes-page__groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.notes-page__group {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}
.notes-page__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.notes-page__group-head a { color: var(--foreground); text-decoration: none; }
.notes-page__group-head a:hover { color: var(--accent); }
.notes-page__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notes-page__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--background);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-button);
}
.notes-page__ts {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.notes-page__ts:hover { filter: brightness(1.08); }
.notes-page__text {
  flex: 1;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.notes-page__del {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.notes-page__del:hover { color: var(--status-critical); }

/* ===========================================================
   Admin users page (/portal/admin/users)
   =========================================================== */

.users-flash {
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(245, 166, 35, 0.14);
  border: 1px solid rgba(245, 166, 35, 0.32);
  color: #ffd791;
  font-size: 14px;
}

.users-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.users-stat {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(22, 22, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.users-stat__num {
  font-size: 28px;
  font-weight: 700;
  color: #f5a623;
  line-height: 1.1;
}
.users-stat__lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

.users-create { margin-bottom: 16px; }
.users-create h2 { margin-top: 0; font-size: 18px; }
.users-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-top: 12px;
}
.users-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.users-field span { color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.users-field span em { font-style: normal; color: rgba(255, 255, 255, 0.4); font-weight: 400; }
.users-field input {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 6, 8, 0.55);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.users-field input:focus { outline: none; border-color: rgba(245, 166, 35, 0.6); }
.users-field--wide { grid-column: 1 / -1; }
.users-form__actions { grid-column: 1 / -1; }

.users-list h2 { margin-top: 0; font-size: 18px; }
.users-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 980px;
}
.users-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.users-cell {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
  color: rgba(255, 255, 255, 0.78);
}
.users-cell--name strong { color: #fff; font-size: 14px; }
.users-note { font-size: 12px; color: rgba(255, 255, 255, 0.4); margin-top: 2px; }
.users-cell--num { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.users-cell--time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.users-cell--actions { min-width: 360px; }

.users-row.is-highlight { background: rgba(245, 166, 35, 0.06); }
.users-row.is-highlight .users-cell { border-color: rgba(245, 166, 35, 0.3); }

.users-link-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.users-link {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 6, 8, 0.55);
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn--sm { font-size: 12px; padding: 0 10px; height: 28px; min-height: 28px; }
.btn--danger { color: #ff8b8b; }
.btn--danger:hover { background: rgba(255, 80, 80, 0.12); border-color: rgba(255, 80, 80, 0.4); }

.users-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.users-badge--ok { background: rgba(80, 200, 120, 0.16); color: #7fe0a0; border: 1px solid rgba(80, 200, 120, 0.32); }
.users-badge--idle { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.65); border: 1px solid rgba(255, 255, 255, 0.12); }
.users-badge--pending { background: rgba(245, 166, 35, 0.14); color: #ffd791; border: 1px solid rgba(245, 166, 35, 0.32); }

@media (max-width: 768px) {
  .users-stats { grid-template-columns: repeat(2, 1fr); }
  .users-form { grid-template-columns: 1fr; }
  .users-cell--actions { min-width: 280px; }
}
