/* ============================================================
   Video Portal — Global stylesheet (Phase 1)
   Blue & white theme · gold/bronze accent #e1ad62
   Animated fluid blue/white background + light/dark crossfade
   ============================================================ */

/* ---------- Design tokens -------------------------------------- */
/* Light theme (default) */
:root {
  color-scheme: light;

  /* Brand */
  --brand-blue: #0068b3;
  --brand-gold: #e1ad62;
  --brand-gold-deep: #c8904a;
  --glass-gold: #e78943;
  --glass-gold-light: #f0a968;
  --glass-gold-deep: #c96a28;

  /* Golden glass buttons — light mode (frosted over white) */
  --btn-glass-bg: linear-gradient(135deg, rgba(231, 137, 67, 0.28), rgba(225, 173, 98, 0.18));
  --btn-glass-border: rgba(231, 137, 67, 0.42);
  --btn-glass-text: #5a3208;
  --btn-glass-shadow: 0 8px 24px rgba(231, 137, 67, 0.22);
  --btn-glass-hover: linear-gradient(135deg, rgba(231, 137, 67, 0.38), rgba(240, 169, 104, 0.28));
  --btn-glass-ghost-bg: rgba(255, 255, 255, 0.45);
  --btn-glass-ghost-border: rgba(231, 137, 67, 0.35);

  /* Glass panels */
  --glass-panel-bg: rgba(255, 255, 255, 0.62);
  --glass-panel-border: rgba(231, 137, 67, 0.28);

  /* Surfaces & text */
  --bg-base: #eef5fd;
  --ink: #102a43;
  --ink-soft: #486a8c;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.95);
  --ring: rgba(0, 104, 179, 0.4);

  /* Shared utility tokens (used by Phase 3–5 sections) */
  --border: rgba(16, 42, 67, 0.12);
  --muted: #54708f;
  --shadow: 0 4px 16px rgba(0, 40, 90, 0.08);

  /* Phase 3 dashboard: starts at #0068b3, fades to white in light mode */
  --dashboard-bg: #ffffff;

  /* Shape & motion */
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-card: 0 10px 30px rgba(0, 60, 120, 0.14);
  --transition-theme: 0.55s ease;
}

/* Dark theme */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg-base: #04070c;
  --ink: #eaf3ff;
  --ink-soft: #9db8d6;
  --card-bg: rgba(13, 24, 38, 0.82);
  --card-border: rgba(120, 170, 225, 0.28);
  --ring: rgba(96, 165, 250, 0.5);

  /* Shared utility tokens (used by Phase 3–5 sections) */
  --border: rgba(157, 184, 214, 0.22);
  --muted: #9db8d6;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.45);

  /* Phase 3 dashboard: fades to black in dark mode */
  --dashboard-bg: #000000;

  /* Golden glass buttons — dark mode (rich golden gradient) */
  --btn-glass-bg: linear-gradient(135deg, rgba(201, 106, 40, 0.55), rgba(231, 137, 67, 0.32));
  --btn-glass-border: rgba(240, 169, 104, 0.45);
  --btn-glass-text: #fff8ef;
  --btn-glass-shadow: 0 10px 28px rgba(231, 137, 67, 0.35);
  --btn-glass-hover: linear-gradient(135deg, rgba(231, 137, 67, 0.65), rgba(201, 106, 40, 0.42));
  --btn-glass-ghost-bg: rgba(20, 16, 10, 0.45);
  --btn-glass-ghost-border: rgba(231, 137, 67, 0.38);

  --glass-panel-bg: rgba(12, 10, 8, 0.55);
  --glass-panel-border: rgba(231, 137, 67, 0.32);

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg-base);
  overflow-x: hidden;
  position: relative;
  transition:
    background-color var(--transition-theme),
    color var(--transition-theme);
}

/* ============================================================
   Animated fluid blue/white background
   Two fixed layers (light + dark) with a flowing 300% gradient
   and slow-drifting blurred orbs; they crossfade on toggle.
   ============================================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  transition: opacity var(--transition-theme);
}

.bg-layer--light {
  background: linear-gradient(
    115deg,
    #ffffff 0%,
    #d8ecff 20%,
    #9ccbf5 40%,
    #ffffff 58%,
    #c3e3ff 80%,
    #ffffff 100%
  );
  background-size: 300% 300%;
  animation: bg-flow 22s ease-in-out infinite;
}

.bg-layer--dark {
  background: linear-gradient(
    115deg,
    #04070c 0%,
    #0a1a2e 20%,
    #12355c 40%,
    #04070c 58%,
    #0d2340 80%,
    #04070c 100%
  );
  background-size: 300% 300%;
  animation: bg-flow 22s ease-in-out infinite;
}

@keyframes bg-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Drifting blurred orbs (soft light blobs floating across the scene) */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
  animation: orb-drift 26s ease-in-out infinite alternate;
}

.bg-orb--1 {
  width: 46vmax; height: 46vmax;
  top: -14vmax; left: -10vmax;
}
.bg-orb--2 {
  width: 34vmax; height: 34vmax;
  top: 30%; right: -12vmax;
  animation-duration: 32s;
  animation-delay: -6s;
}
.bg-orb--3 {
  width: 30vmax; height: 30vmax;
  bottom: -12vmax; left: 22%;
  animation-duration: 38s;
  animation-delay: -14s;
}
.bg-orb--4 {
  width: 22vmax; height: 22vmax;
  top: 8%; left: 48%;
  animation-duration: 44s;
  animation-delay: -22s;
}

/* Light layer orb colors: blue / white / gold */
.bg-layer--light .bg-orb--1 { background: rgba(0, 104, 179, 0.32); }
.bg-layer--light .bg-orb--2 { background: rgba(255, 255, 255, 0.95); }
.bg-layer--light .bg-orb--3 { background: rgba(122, 179, 239, 0.45); }
.bg-layer--light .bg-orb--4 { background: rgba(225, 173, 98, 0.30); }

/* Dark layer orb colors: deep blues + faint gold */
.bg-layer--dark .bg-orb--1 { background: rgba(0, 104, 179, 0.50); }
.bg-layer--dark .bg-orb--2 { background: rgba(30, 80, 140, 0.45); }
.bg-layer--dark .bg-orb--3 { background: rgba(13, 50, 95, 0.60); }
.bg-layer--dark .bg-orb--4 { background: rgba(225, 173, 98, 0.16); }

@keyframes orb-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vmax, -4vmax, 0) scale(1.15); }
  100% { transform: translate3d(-5vmax, 5vmax, 0) scale(0.92); }
}

/* Theme crossfade: only one layer visible at a time */
.bg-layer--dark { opacity: 0; }
html[data-theme="dark"] .bg-layer--light { opacity: 0; }
html[data-theme="dark"] .bg-layer--dark { opacity: 1; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-layer--light,
  .bg-layer--dark,
  .bg-orb {
    animation: none;
  }
}

/* ============================================================
   Theme toggle button
   ============================================================ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background-color var(--transition-theme),
    color var(--transition-theme),
    border-color var(--transition-theme),
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.theme-toggle .icon {
  width: 26px;
  height: 26px;
  position: absolute;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.theme-toggle .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

html[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }

/* ============================================================
   Phase 2 — landing page + registration gate + dashboard stub
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 64px;
  gap: 48px;
}

.landing {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px);
  gap: 40px;
  align-items: center;
}

@media (max-width: 940px) {
  .landing {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.hero-card {
  width: 100%;
  padding: 48px 40px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme);
}

.hero-logo {
  width: 96px;
  height: auto;
  margin: 0 0 18px;
  display: block;
}

.hero-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-gold-deep);
  margin-bottom: 10px;
}

html[data-theme="dark"] .hero-kicker {
  color: var(--brand-gold);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero-sub {
  color: var(--ink-soft);
  line-height: 1.65;
}

.hero-features {
  list-style: none;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.hero-features .check {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), #1e86d4);
  border: 1px solid var(--brand-gold);
  box-shadow: 0 2px 8px rgba(0, 60, 120, 0.25);
}

.gold-divider {
  width: 72px;
  height: 4px;
  border-radius: 2px;
  margin: 26px 0 0;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}

.site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 22px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
  transition:
    background-color var(--transition-theme),
    color var(--transition-theme),
    border-color var(--transition-theme);
}

.site-footer .gold {
  color: var(--brand-gold-deep);
  font-weight: 600;
}

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

/* ============================================================
   Registration / login gate card
   ============================================================ */
.auth-card {
  position: relative;
  padding: 30px 30px 26px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme);
}

/* Thin gold highlight line across the top of the card */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  background: rgba(0, 60, 120, 0.07);
  border: 1px solid var(--card-border);
  transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

html[data-theme=dark] .auth-tabs {
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab {
  position: relative;
  z-index: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 40, 90, 0.18);
  border-bottom: 2px solid var(--brand-gold);
}

html[data-theme="dark"] .site-footer .gold {
  color: var(--brand-gold);
}

/* ============================================================
   PHASE 3 — top bar, video cards & dashboard
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.65rem clamp(1rem, 3vw, 1.75rem);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition:
    background-color var(--transition-theme),
    border-color var(--transition-theme);
}

html[data-theme="dark"] .topbar {
  background: rgba(10, 12, 18, 0.78);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.topbar-nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.topbar-nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar-nav a:hover {
  color: var(--ink);
  background: var(--card-bg);
}

/* ============================================================
   LANDING UI SHELL (index.html)
   Header split · central container grid · intro typography ·
   QR sign-in card · premium gold CTA
   ============================================================ */

/* --- shared shell components: logo + icon button --- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  line-height: 1;
  min-height: 45px;
  flex-shrink: 0;
}

.brand span {
  white-space: nowrap;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .brand span {
    white-space: normal;
    max-width: 10.5rem;
    font-size: 0.82rem;
  }
}

.brand img,
.brand-logo {
  width: 80px;
  height: 45px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: left center;
  flex: none;
  display: block;
  border-radius: 6px;
}

.icon-btn {
  flex: none;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--btn-glass-ghost-border);
  border-radius: 12px;
  background: var(--btn-glass-ghost-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--btn-glass-shadow);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color var(--transition-theme),
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

.icon-btn:hover {
  border-color: var(--glass-gold);
  background: var(--btn-glass-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(231, 137, 67, 0.28);
}

.icon-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.icon-btn .icon-sun,
.icon-btn .icon-moon {
  position: absolute;
  font-size: 1.15rem;
  line-height: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.icon-btn .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
.icon-btn .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

html[data-theme="dark"] .icon-btn .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .icon-btn .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }

/* --- buttons: premium golden glassmorphism --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  padding: 0.82rem 1.55rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--btn-glass-text);
  cursor: pointer;
  box-shadow: var(--btn-glass-shadow);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color var(--transition-theme);
}

.btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--btn-glass-hover);
  box-shadow: 0 14px 32px rgba(231, 137, 67, 0.32);
  border-color: rgba(240, 169, 104, 0.55);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn-primary {
  /* inherits golden glass base */
}

.btn-ghost {
  background: var(--btn-glass-ghost-bg);
  border-color: var(--btn-glass-ghost-border);
  color: var(--ink-soft);
  box-shadow: 0 4px 16px rgba(0, 40, 90, 0.08);
}

html[data-theme="dark"] .btn-ghost {
  color: var(--ink-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--btn-glass-hover);
  border-color: var(--btn-glass-border);
}

.btn-sm {
  padding: 0.48rem 0.95rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

.btn-copy {
  gap: 0.35rem;
}

.btn-copy::before {
  content: "⎘";
  font-size: 0.95rem;
  opacity: 0.85;
}

/* --- central container: responsive two-column grid --- */

.landing-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(480px, 560px);
  gap: 2.5rem;
  align-items: stretch;
}

.landing-main {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}

.landing-auth {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.intro-video-wrap {
  width: 100%;
}

.intro-video-label {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-gold-deep);
}

html[data-theme="dark"] .intro-video-label {
  color: var(--brand-gold);
}

.intro-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #000;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
}

@media (max-width: 1080px) {
  .landing-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
    align-items: start;
  }

  .landing-auth,
  .qr-panel {
    min-height: 0;
    height: auto;
  }

  .intro h1 {
    white-space: normal;
    font-size: clamp(1.55rem, 5vw, 2.2rem);
  }
}

/* --- intro typography: readable column, line-height 1.6 --- */

.intro {
  max-width: none;
}

.intro h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.05vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
}

.intro .accent {
  color: var(--brand-gold-deep);
}

html[data-theme="dark"] .intro .accent {
  color: var(--brand-gold);
}

.intro p {
  margin: 0 0 1.25rem;
  max-width: 60ch;
  line-height: 1.6;
  font-size: 1.02rem;
  color: var(--ink-soft);
}

/* --- QR sign-in card: prominent, centered, modern --- */

.qr-panel {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 2.6rem 2.35rem;
  box-sizing: border-box;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme);
}

.qr-idle:not([hidden]),
.qr-live:not([hidden]),
.qr-ok:not([hidden]) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
}

/* thin gold highlight across the top of the card */
.qr-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}

.qr-idle h2,
.qr-ok h2 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.qr-idle-note {
  margin: 0 0 1.5rem;
  line-height: 1.6;
  color: var(--muted);
}

.qr-steps {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  text-align: left;
}

.qr-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1.05rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-panel-border);
  border-radius: 14px;
  box-shadow:
    0 12px 28px rgba(0, 40, 90, 0.18),
    0 3px 8px rgba(0, 40, 90, 0.1);
}

html[data-theme="dark"] .qr-steps li {
  background: rgba(13, 24, 38, 0.92);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.35);
}

.qr-steps li b {
  flex: none;
  min-width: 1.7rem;
  color: var(--brand-gold-deep);
  font-size: 1.05rem;
}

.qr-steps li span {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] .qr-steps li b {
  color: var(--brand-gold);
}

/* --- buttons: (see golden glass block above) --- */

.form-error {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #b02a37;
}

/* --- live QR state --- */

.qr-live .qr-frame {
  width: 280px;
  height: 280px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.code-chip {
  font-family: "Cascadia Code", ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  background: rgba(27, 79, 167, 0.08);
  border: 1px solid var(--card-border);
  color: var(--ink);
}

.qr-timer {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --- success state --- */

.ok-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), #1e86d4);
  border: 2px solid var(--brand-gold);
  box-shadow: 0 6px 18px rgba(0, 60, 120, 0.3);
}

.qr-live .btn {
  width: 100%;
}

/* --- video cards (landing grid + dashboard) --- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* Dashboard (Metro) grid — hard cap of 2 tiles per row, spacious gaps */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}

@media (max-width: 640px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.grid-note {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 40, 90, 0.16);
}

.video-card--clickable {
  cursor: pointer;
}

.video-card--clickable:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.video-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 168px;
  font-size: 2.6rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 104, 179, 0.18), rgba(231, 137, 67, 0.16));
  border: 1px solid var(--glass-panel-border);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.video-card:hover .video-thumb img {
  transform: scale(1.04);
}

.video-thumb--fallback {
  background: linear-gradient(135deg, rgba(27, 79, 167, 0.14), rgba(247, 183, 51, 0.18));
}

.video-card--done {
  border-color: rgba(26, 127, 55, 0.35);
  box-shadow: 0 8px 24px rgba(26, 127, 55, 0.12);
}

.video-complete-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(26, 127, 55, 0.92), rgba(52, 199, 89, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(26, 127, 55, 0.35);
  backdrop-filter: blur(8px);
}

.video-status {
  flex-basis: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.video-status--done {
  color: #1a7f37;
}

html[data-theme="dark"] .video-status--done {
  color: #34c759;
}

.video-card--done .video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 127, 55, 0.12);
  pointer-events: none;
}

#btnMarkDone.is-complete {
  border-color: rgba(26, 127, 55, 0.45);
  background: linear-gradient(135deg, rgba(26, 127, 55, 0.35), rgba(52, 199, 89, 0.22));
  color: #0d3d1a;
}

html[data-theme="dark"] #btnMarkDone.is-complete {
  color: #eaffef;
}

/* --- congratulations modal --- */

body.modal-open {
  overflow: hidden;
}

.celebrate-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.celebrate-modal[hidden] {
  display: none;
}

.celebrate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.celebrate-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  text-align: center;
  padding: 2rem 1.75rem 1.75rem;
  animation: celebrate-in 0.45s ease;
}

@keyframes celebrate-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.celebrate-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.celebrate-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.celebrate-msg {
  margin: 0 0 0.35rem;
  color: var(--muted);
  line-height: 1.55;
}

.celebrate-tagline {
  margin: 0 0 1.35rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.5;
}

.celebrate-tagline .accent {
  color: var(--glass-gold);
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
}

.video-title {
  flex-basis: 100%;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.video-duration {
  font-size: 0.85rem;
  color: var(--muted);
}

.video-level {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.video-level.level-beginner { color: #1a7f37; border-color: rgba(26, 127, 55, 0.35); }
.video-level.level-intermediate { color: #9a6700; border-color: rgba(154, 103, 0, 0.35); }
.video-level.level-advanced { color: #b02a37; border-color: rgba(176, 42, 55, 0.35); }

.video-watch-btn {
  align-self: flex-start;
}

/* --- dashboard --- */

body.page-dash {
  background-color: #0068b3;
  transition:
    background-color var(--transition-theme),
    color var(--transition-theme);
}

html[data-theme="light"] body.page-dash {
  background-color: #ffffff;
}

html[data-theme="dark"] body.page-dash {
  background-color: #000000;
}

.me-chip {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--btn-glass-ghost-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--btn-glass-ghost-border);
  line-height: 1;
}

.progress-block {
  margin-top: 0.75rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.dash-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.dash-head {
  margin-bottom: 1.5rem;
}

.dash-title {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.dash-sub {
  margin: 0;
  color: var(--muted);
}

.dash-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.empty-emoji {
  display: block;
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-text {
  margin: 0;
  font-size: 1rem;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-gold), #f6c453);
  transition: width 0.3s ease;
}

.progress-fill--done {
  background: linear-gradient(90deg, #1a7f37, #34c759);
}

/* ============================================================
   PHASE 4 — watch page
   ============================================================ */

body.page-watch {
  min-height: 100vh;
}

.watch-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}

.watch-lesson {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.player-shell {
  width: 100%;
}

.player-shell video,
#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
}

.speed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.speed-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.35rem;
}

.speed-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-ghost-border);
  background: var(--btn-glass-ghost-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(231, 137, 67, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.speed-btn:hover,
.speed-btn.is-active {
  border-color: var(--btn-glass-border);
  background: var(--btn-glass-hover);
  color: var(--btn-glass-text);
  transform: translateY(-1px);
}

/* --- golden glass panels --- */

.glass-panel {
  background: var(--glass-panel-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.35rem;
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme);
}

.glass-panel::before {
  content: "";
  display: block;
  height: 3px;
  margin: -1.25rem -1.35rem 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, transparent, var(--glass-gold), var(--glass-gold-light), transparent);
  opacity: 0.85;
}

.snippet-resource-panel {
  margin-top: 0.25rem;
}

.snippet-resource-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.snippet-resource-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.resource-glass-row {
  margin-bottom: 1rem;
}

.watch-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
}

.watch-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.snippet-block {
  margin-bottom: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--glass-panel-border);
  border-radius: 14px;
  background: rgba(231, 137, 67, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="dark"] .snippet-block {
  background: rgba(231, 137, 67, 0.1);
}

.snippet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}

.snippet-code {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.88);
  color: #f3f6fb;
  font-family: "Cascadia Code", ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(231, 137, 67, 0.22);
}

html[data-theme="light"] .snippet-code {
  background: rgba(16, 24, 36, 0.92);
}

.btn-copy.is-copied {
  border-color: rgba(26, 127, 55, 0.55);
  background: linear-gradient(135deg, rgba(26, 127, 55, 0.35), rgba(52, 199, 89, 0.22));
}

.watch-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* --- playback controls --- */

.watch-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.watch-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.watch-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-gold), #f6c453);
}

.watch-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.watch-time {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* speed dropdown */

.speed-select {
  cursor: pointer;
  font-weight: 700;
  border-radius: 8px;
}

.speed-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 96px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 40, 90, 0.2);
  padding: 0.3rem;
  z-index: 30;
}

.speed-menu.open { display: flex; }

.speed-option {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
}

.speed-option:hover { background: rgba(27, 79, 167, 0.1); }

.speed-option--active {
  font-weight: 700;
  color: var(--brand-gold);
}

/* --- snippets --- */

.watch-snippets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.snippet {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.snippet:hover {
  border-color: var(--brand-gold);
  transform: translateX(3px);
}

.snippet-time {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-gold);
  background: rgba(247, 183, 51, 0.14);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

.snippet-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.snippet-body strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snippet-body small {
  color: var(--muted);
  font-size: 0.8rem;
}

/* --- sidebar --- */

.watch-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 84px;
}

.side-card {
  padding: 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.side-title {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  min-width: 0;
}

.resource-item a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-item a:hover { color: var(--brand-gold); }

.resource-icon { flex: 0 0 auto; }

.watch-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.watch-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  font-size: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(27, 79, 167, 0.14), rgba(247, 183, 51, 0.18));
  border: 1px solid var(--border);
}

.watch-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.watch-card-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.watch-card-btn {
  align-self: flex-start;
  text-decoration: none;
  display: inline-block;
  font-weight: 700;
}

.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   PHASE 5 — admin panel
   ============================================================ */

.admin-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.admin-title {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.admin-btn {
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.52rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--btn-glass-text);
  box-shadow: var(--btn-glass-shadow);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.admin-btn:hover {
  transform: translateY(-1px);
  background: var(--btn-glass-hover);
  box-shadow: 0 10px 24px rgba(231, 137, 67, 0.28);
}

.admin-btn-primary {
  /* uses golden glass base */
}

.admin-btn-danger {
  background: linear-gradient(135deg, rgba(176, 42, 55, 0.75), rgba(148, 31, 44, 0.55));
  border-color: rgba(176, 42, 55, 0.65);
  color: #fff;
  box-shadow: 0 8px 20px rgba(176, 42, 55, 0.28);
}

.admin-btn-danger:hover {
  background: linear-gradient(135deg, rgba(176, 42, 55, 0.9), rgba(148, 31, 44, 0.7));
}

.admin-search {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
}

.admin-search:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 1px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.93rem;
}

.admin-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
  background: rgba(27, 79, 167, 0.06);
}

.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: 0; }

.admin-cell-title { font-weight: 700; }

.admin-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.admin-badge--published { color: #1a7f37; border-color: rgba(26, 127, 55, 0.35); }
.admin-badge--draft { color: #9a6700; border-color: rgba(154, 103, 0, 0.35); }

.admin-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.admin-status {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.2em;
}

.admin-status--ok { color: #1a7f37; }
.admin-status--err { color: #b02a37; }

.admin-form {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.admin-form h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem 1.2rem;
}

.admin-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-form-grid input,
.admin-form-grid select {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.admin-form-grid input:focus-visible,
.admin-form-grid select:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 1px;
}

.admin-form-actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-form-error {
  color: #b02a37;
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- admin lesson editor (Phase 7) --- */

.admin-login h1 {
  margin-bottom: 0.35rem;
}

.reader-sub {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  margin-bottom: 0.85rem;
}

.field:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 1px;
}

.btn-block {
  width: 100%;
}

.admin-picker {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
}

.admin-save-note {
  margin: 0.35rem 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.admin-save-note b {
  font-family: ui-monospace, monospace;
  color: var(--ink);
}

/* ============================================================
   /qr-reader — phone scan + verify
   ============================================================ */

.page-reader {
  min-height: 100vh;
}

.reader-wrap {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.reader-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.reader-code-box {
  margin: 1.25rem 0;
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--glass-panel-border);
  background: rgba(231, 137, 67, 0.08);
}

.reader-code-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.reader-code {
  font-family: ui-monospace, monospace;
  font-size: 1.75rem;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.qr-scanner-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 320px;
  margin: 1rem 0 0.75rem;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--glass-panel-border);
}

.qr-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qr-scanner-frame {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(231, 137, 67, 0.85);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.qr-scanner-hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.qr-manual-entry {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.qr-manual-entry summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.admin-lesson {
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.admin-lesson-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.admin-lesson-file {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.admin-snippet {
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(0, 60, 120, 0.04);
}

.admin-add-snippet {
  margin-right: auto;
}

.admin-snippet-section {
  margin: 1rem 0;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.admin-snippet-heading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.admin-snippet-help {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.admin-snippet-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .admin-snippet-grid { grid-template-columns: 1fr; }
}

.admin-thumb-section {
  margin: 0.35rem 0 1.1rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px dashed var(--border);
}

.admin-thumb-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.admin-thumb-preview {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #002147;
}

.admin-thumb-name {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.admin-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.admin-thumb-choice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.admin-thumb-choice img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #002147;
  display: block;
}

.admin-thumb-choice span {
  font-size: 0.72rem;
  line-height: 1.3;
  word-break: break-all;
  color: var(--muted);
}

.admin-thumb-choice:hover {
  border-color: var(--brand-gold, #e1ad62);
  transform: translateY(-1px);
}

.admin-thumb-choice.is-selected {
  border-color: var(--brand-gold, #e78943);
  box-shadow: 0 0 0 2px rgba(231, 137, 67, 0.45);
}

.admin-thumb-upload {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-thumb-upload .field {
  margin-bottom: 0;
}

/* --- watch page snippet panel --- */

.watch-snippets-card {
  margin-top: 0.5rem;
}

.watch-card-head h2 {
  margin: 0 0 0.35rem;
}

.watch-card-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.watch-snippets-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.snippet-empty {
  margin: 0;
  padding: 1.1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  border: 1px dashed var(--glass-panel-border);
  border-radius: 12px;
  background: rgba(231, 137, 67, 0.05);
}

.snippet-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.snippet-meta strong {
  font-size: 0.95rem;
}

.snippet-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--brand-gold-deep);
  background: rgba(225, 173, 98, 0.12);
}

html[data-theme="dark"] .snippet-type-badge {
  color: var(--brand-gold);
}

.snippet-block--command .snippet-type-badge {
  color: #0068b3;
  background: rgba(0, 104, 179, 0.12);
}

.snippet-block--prompt .snippet-type-badge {
  color: #7a4b00;
  background: rgba(225, 173, 98, 0.18);
}

.snippet-copy-btn {
  flex: none;
}

/* --- admin unique QR-reader invites --- */

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.admin-tab {
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-soft);
}

.admin-tab.is-active {
  color: var(--btn-glass-text);
  border-color: var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
}

.admin-invite-form {
  padding: 1.15rem 1.2rem 0.4rem;
  margin-bottom: 1.35rem;
}

.admin-invite-form .field {
  margin-bottom: 0;
}

.admin-invite-table-wrap {
  overflow-x: auto;
}

.admin-invite-email {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.admin-invite-url {
  max-width: 28rem;
}

.admin-invite-url code {
  display: block;
  font-size: 0.72rem;
  line-height: 1.45;
  word-break: break-all;
  color: var(--ink);
}

.admin-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .admin-invite-url { max-width: 16rem; }
}