/* 
 * Edu Studio - Premium Modern Stylesheet
 * Brand Accent: Emerald & Slate
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  
  /* Core Palette */
  --bg: #f8fafc;
  --bg-dark: #0f172a;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-soft: #f1f5f9;
  
  /* Text Colors */
  --ink: #0f172a;
  --muted: #64748b;
  
  /* Borders */
  --line: rgba(226, 232, 240, 0.8);
  
  /* Theme Accents (Emerald / Jade) */
  --accent: #10b981;
  --accent-dark: #047857;
  --accent-light: rgba(16, 185, 129, 0.08);
  --accent-glow: rgba(16, 185, 129, 0.15);
  
  /* Secondary Accents */
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.08);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.08);
  --warning: #f59e0b;
  --error: #ef4444;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.08);
  
  /* Elevation & Shadows */
  --shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 10px 30px -10px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
  
  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Transitions */
  --transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shared workflow polish: H5P Generator Studio, Video Authoring, Simulation, Viewer */
.icon-eye {
  width: 1.18em;
  height: 1.18em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.icon-link,
.generated-file-actions .icon-link,
.profile-icon-action.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.workflow-page-footer,
.viewer-tabs,
.studio-switch-strip,
.simulation-actions {
  border: 1px solid rgba(203, 213, 225, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 35px -25px rgba(15, 23, 42, 0.35);
}

.workflow-page-footer {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.page-progress-line {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.82), rgba(239, 246, 255, 0.82));
}

.page-progress-line progress {
  width: 100%;
  min-width: 120px;
  accent-color: var(--accent);
}

.page-progress-line span {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.82rem;
  text-align: right;
}

.rail-section {
  border-radius: var(--radius-lg);
}

.rail-link,
.profile-side-nav button,
.profile-workflow-link {
  min-height: 46px;
  align-items: center;
}

.file-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
}

.file-group + .file-group {
  margin-top: 10px;
}

.file-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 8px;
  color: var(--ink);
}

.file-group-heading strong {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-group-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 850;
}

.profile-file-card,
.log-item,
.admin-message-panel {
  padding: 18px;
}

.admin-message-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.74);
}

.admin-message-panel h3 {
  margin: 0;
}

.notification-item.unread {
  border-color: rgba(16, 185, 129, 0.36);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.86), #ffffff);
}

.notification-item p,
.error-text {
  margin: 4px 0 0;
  line-height: 1.5;
}

.error-text {
  color: #b42318;
  font-weight: 700;
}

@media (max-width: 820px) {
  .page-progress-line {
    grid-template-columns: 1fr;
  }

  .page-progress-line span {
    text-align: left;
  }

  .profile-file-card,
  .log-item-with-action {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Orbs */
.backdrop-gradient {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.28;
  mix-blend-mode: multiply;
  animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(59, 130, 246, 0.1) 100%);
  top: -200px;
  right: -100px;
  animation-duration: 25s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
  bottom: -150px;
  left: -100px;
  animation-delay: -5s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  animation-duration: 30s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-30px, -40px) scale(0.95); }
}

.platform-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Site Navigation & Brand Logo */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) minmax(112px, auto) auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 12px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
}

.brand-mark {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: var(--transition-fast);
}

.brand-mark:hover {
  transform: translateY(-1px);
}

.brand-symbol {
  display: inline-grid;
  place-items: center;
  width: 84px;
  min-width: 84px;
  height: 64px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: none;
  border: 0;
  overflow: hidden;
}

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

.brand-mark strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-mark small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-links,
.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  grid-column: 2;
  justify-content: flex-end;
  min-width: 0;
}

.nav-links button,
.nav-links a,
.rail-link {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.nav-links button:hover,
.nav-links a:hover,
.nav-links button.active,
.nav-links a.active,
.rail-link.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.nav-links [data-icon]::before {
  display: none;
}

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.menu-toggle span + span {
  margin-top: 5px;
}

.site-nav.nav-open .menu-toggle {
  background: var(--accent-light);
  border-color: rgba(16, 185, 129, 0.24);
}

/* Account Actions */
.account-actions button,
.account-actions a {
  border-radius: var(--radius-md);
  font-weight: 600;
}

.portal-language-switch {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-width: max-content;
}

.portal-language-switch select {
  min-height: 38px;
  max-width: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 34px 8px 12px;
  background-color: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.toggle-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: auto;
  padding: 16px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.74), rgba(255, 255, 255, 0.82));
}

.toggle-card input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.toggle-card strong,
.toggle-card small {
  display: block;
}

.toggle-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-menu {
  position: relative;
}

.account-actions {
  grid-column: 4;
  justify-self: end;
  justify-content: flex-end;
  min-width: max-content;
}

.profile-trigger {
  min-height: 46px;
  padding: 6px 12px 6px 8px;
  gap: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 800;
}

.profile-avatar img,
.avatar img,
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-native-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.portal-file-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 8px;
  max-width: 100%;
  cursor: pointer;
  color: var(--ink);
}

.portal-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .05);
}

.portal-file-name {
  min-width: 0;
  max-width: min(44ch, 100%);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-file-control:focus-visible .portal-file-button {
  outline: 3px solid rgba(16, 185, 129, .24);
  border-color: var(--accent);
}

.profile-label {
  display: grid;
  gap: 1px;
  text-align: left;
  line-height: 1.1;
}

.profile-label strong {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.profile-label small {
  color: var(--muted);
  font-size: 0.72rem;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  display: grid;
  min-width: min(360px, calc(100vw - 24px));
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.profile-dropdown button {
  display: grid;
  grid-template-columns: 24px max-content;
  justify-content: flex-start;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  box-shadow: none;
  white-space: nowrap;
  gap: 12px;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.1;
  text-align: left;
}

.profile-dropdown button[data-icon]::before {
  min-width: 24px;
  text-align: center;
}

.profile-dropdown button:hover {
  background: var(--surface-soft);
  color: var(--accent-dark);
  transform: none;
}

/* Button & Action Overrides */
button,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-color: var(--accent-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

button:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3), var(--shadow-glow);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none !important;
  box-shadow: none !important;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.secondary:hover {
  border-color: var(--muted);
  background: var(--surface-soft);
  transform: translateY(-1.5px);
}

.compact {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.danger-button {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.danger-button:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.admin-icon-command {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
}

.admin-icon-command.activity-delete-button {
  align-self: start;
  flex: 0 0 auto;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

/* Icon glyph helper */
button[data-icon]::before,
.secondary[data-icon]::before,
.nav-links a[data-icon]::before,
.rail-link[data-icon]::before {
  content: attr(data-icon);
  display: inline-block;
  min-width: 1em;
  color: currentColor;
  font-size: 1.05em;
  line-height: 1;
  font-weight: 700;
  transition: transform 0.2s ease;
}

button:hover[data-icon]::before {
  transform: scale(1.1);
}

/* Layout Views */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.view-section.active {
  display: block;
}

html.boot-creator-route .view-section {
  display: none;
}

html.boot-creator-route #creatorView {
  display: grid;
}

html.boot-creator-route #homeView.active {
  display: none;
}

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

/* Landing Page - Hero */
.hero {
  min-height: 78vh;
  display: grid;
  align-items: center;
  position: relative;
  background-image: linear-gradient(to bottom, rgba(248, 250, 252, 0.8), rgba(248, 250, 252, 0.95)),
                    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=82");
  background-position: center;
  background-size: cover;
  padding: 48px 0;
  overflow: hidden;
}

.hero-overlay {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  border-radius: 99px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  max-width: 800px;
  margin: 0 auto;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--bg-dark);
  letter-spacing: -0.03em;
}

.hero p:not(.eyebrow) {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* Feature band styling */
.home-band {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
}

.section-heading {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}

.section-heading h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bg-dark);
  margin-top: 8px;
  line-height: 1.2;
}

.section-heading p {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Feature Grid Cards */
.features-showcase {
  padding-bottom: 64px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 28px;
  align-items: stretch;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(16,185,129,0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.feature-card:hover::before {
  opacity: 1;
}

/* Card header: icon + badge */
.feature-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(16, 185, 129, 0.12);
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icon color variants */
.feature-icon.icon-ai {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.15);
}
.feature-card:hover .icon-ai {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.feature-icon.icon-video {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.15);
}
.feature-card:hover .icon-video {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.feature-icon.icon-lms {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
  border-color: rgba(20, 184, 166, 0.15);
}
.feature-card:hover .icon-lms {
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.feature-icon.icon-viewer {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.15);
}
.feature-card:hover .icon-viewer {
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.feature-icon.icon-admin {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.15);
}
.feature-card:hover .icon-admin {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.feature-icon.icon-tracking {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
  border-color: rgba(244, 63, 94, 0.15);
}
.feature-card:hover .icon-tracking {
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.feature-icon.icon-security {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.15);
}
.feature-card:hover .icon-security {
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

/* Feature badge */
.feature-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent-dark);
  line-height: 1.5;
}

.feature-badge.badge-ai {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}
.feature-badge.badge-video {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}
.feature-badge.badge-lms {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
}
.feature-badge.badge-viewer {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
}
.feature-badge.badge-admin {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.feature-badge.badge-ops {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
}
.feature-badge.badge-security {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

/* Card typography */
.feature-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--bg-dark);
}

.feature-card > p {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 18px;
}

/* Feature bullet highlights */
.feature-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: auto;
}

.feature-highlights li {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #475569;
  padding-left: 24px;
  position: relative;
}

.feature-highlights li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
}

/* Split Workflow Band */
.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  column-gap: 56px;
  row-gap: 36px;
  align-items: center;
}

.workflow-list {
  display: grid;
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
}

.workflow-list li {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1.72fr);
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.workflow-list li strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bg-dark);
}

.workflow-list li span {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Trust card & Metrics */
.trust-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--accent);
}

.trust-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 750;
  margin: 0 0 10px;
  color: var(--bg-dark);
}

.trust-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.metric-row span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: var(--radius-md);
  padding: 14px 10px;
  background: var(--surface-soft);
  text-align: center;
  border: 1px solid var(--line);
  transition: var(--transition);
}

.metric-row span:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.2);
  background: var(--surface-solid);
}

.metric-row strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.metric-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Pricing Grid Layout */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px 28px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: var(--transition);
  min-height: 420px;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 20px 48px rgba(16, 185, 129, 0.12);
  transform: scale(1.03);
  z-index: 2;
}

.pricing-card.featured:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 25px 50px rgba(16, 185, 129, 0.16);
}

.pricing-card.featured::after {
  content: 'Most Popular';
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-head {
  min-height: 112px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.plan-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--bg-dark);
  margin: 14px 0 8px;
}

.plan-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  font-size: 2.65rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin: 22px 0 10px;
}

.price span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.pricing-card ul {
  display: grid;
  gap: 14px;
  margin: 18px 0 32px;
  padding-left: 20px;
  list-style-type: none;
}

.pricing-card ul li {
  position: relative;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.45;
}

.pricing-card ul li::before {
  content: '✓';
  position: absolute;
  left: -20px;
  color: var(--accent-dark);
  font-weight: 900;
}

.pricing-card button {
  width: 100%;
  margin-top: auto;
}

/* Creator Studio View Layout */
.creator-view {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.creator-view.active {
  display: grid;
}

/* Sidebar Dashboard Rail */
.dashboard-rail {
  position: sticky;
  top: 98px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.rail-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  --rail-group-bg: rgba(255, 255, 255, 0.72);
  --rail-group-border: rgba(15, 23, 42, 0.06);
  --rail-group-title: var(--muted);
}

.rail-section-title {
  display: block;
  padding: 0 4px;
  color: var(--rail-group-title);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-rail > .rail-section {
  border: 1px solid var(--rail-group-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--rail-group-bg);
  box-shadow: var(--shadow-sm);
}

.rail-group-workflow {
  --rail-group-bg: rgba(16, 185, 129, 0.055);
  --rail-group-border: rgba(16, 185, 129, 0.16);
  --rail-group-title: #047857;
}

.rail-group-switch {
  --rail-group-bg: rgba(37, 99, 235, 0.05);
  --rail-group-border: rgba(37, 99, 235, 0.14);
  --rail-group-title: #2563eb;
}

.rail-group-settings {
  --rail-group-bg: rgba(100, 116, 139, 0.055);
  --rail-group-border: rgba(100, 116, 139, 0.16);
  --rail-group-title: #475569;
}

.rail-group-records {
  --rail-group-bg: rgba(14, 165, 233, 0.055);
  --rail-group-border: rgba(14, 165, 233, 0.16);
  --rail-group-title: #0369a1;
}

.rail-group-users {
  --rail-group-bg: rgba(168, 85, 247, 0.052);
  --rail-group-border: rgba(168, 85, 247, 0.14);
  --rail-group-title: #7e22ce;
}

.rail-group-billing {
  --rail-group-bg: rgba(245, 158, 11, 0.06);
  --rail-group-border: rgba(245, 158, 11, 0.18);
  --rail-group-title: #b45309;
}

.rail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
}

.user-card strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.user-card small {
  font-weight: 600;
  color: var(--accent-dark);
}

.rail-link {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-weight: 600;
  padding: 12px 16px;
}

.rail-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
  transform: translateX(2px);
}

.rail-link.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border-color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transform: none !important;
}

.tool-switch-link {
  color: var(--accent-dark);
  border-color: rgba(16, 185, 129, 0.22);
  background: var(--accent-light);
  text-decoration: none;
}

.layout > .creator-page:not(.active),
.admin-grid > .admin-page:not(.active),
.media-layout > .media-page:not(.active) {
  display: none !important;
}

.layout > .creator-page.active,
.media-layout > .media-page.active {
  display: block;
}

.layout > .creator-page.active {
  grid-column: 1 / -1;
}

.quota-card {
  display: grid;
  gap: 10px;
}

.quota-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quota-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

/* Quota Progress Bar */
progress {
  width: 100%;
  height: 8px;
  border: none;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-soft);
}

progress::-webkit-progress-bar {
  background: var(--surface-soft);
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

/* Topbar Header Dashboard style */
.workspace {
  display: grid;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.topbar h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.topbar p {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--muted);
}

.workflow-status {
  margin-top: 12px !important;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--accent-dark) !important;
  font-weight: 700;
}

.workflow-status.error {
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.25);
  background: #fff5f5;
}

.status-pill {
  min-width: 190px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-pill.ready {
  color: var(--accent-dark);
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--accent-light);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.status-pill.warn {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
  background: var(--amber-soft);
}

/* Layout Panel Grids */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
  gap: 24px;
}

.panel {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow);
}

.upload-panel,
.settings-panel,
.preview-panel,
.image-panel,
.blueprint-panel,
.result-panel,
.media-author-panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.panel-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 4px;
}

.panel-header p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Dropzone PDF Uploader */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  border: 2px dashed rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  padding: 24px;
  position: relative;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1.5px solid var(--line);
  color: var(--accent);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: var(--transition);
}

.source-type-stack {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 92px;
  height: auto;
  min-height: 64px;
  padding: 8px;
  border-radius: var(--radius-md);
}

.source-type-stack span {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 22px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-dark);
  font-size: 0.68rem;
  line-height: 1;
}

.dropzone:hover .drop-icon {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}

.dropzone strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.dropzone small {
  font-size: 0.78rem;
  color: var(--muted);
}

.dropzone small.error {
  color: var(--danger);
  font-weight: 700;
}

/* Form Fields Styling */
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.field-grid.single {
  grid-template-columns: 1fr;
  margin-top: 0;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--ink);
  padding: 10px 14px;
  font-family: inherit;
  font-size: max(0.92rem, 16px);
  line-height: 1.35;
  caret-color: var(--accent-dark);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  box-shadow: var(--shadow-sm);
  transform: none;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), var(--shadow-sm);
}

.settings-note {
  padding: 12px 16px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.85rem;
  line-height: 1.45;
  font-weight: 500;
}

.settings-note.error {
  border-color: rgba(239, 68, 68, 0.2);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Switch styling */
.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.switch-row.stacked {
  display: grid;
  gap: 12px;
}

.switch-row label,
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.h5p-type-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.h5p-type-settings label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
}

.h5p-type-settings span {
  display: grid;
  gap: 2px;
}

.h5p-type-settings small {
  color: var(--muted);
  font-weight: 700;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toggle {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-solid);
}

/* Build Stepper and Progress Tracker */
.result-panel,
.workflow-page-footer {
  display: grid;
  gap: 20px;
  align-content: start;
}

.workflow-page-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.workflow-page-footer .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.page-progress-line {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.progress-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.progress-line span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.build-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.build-steps li {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: var(--transition-fast);
}

.build-steps li::before {
  content: '○';
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.build-steps li.active {
  color: var(--accent-dark);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--accent-light);
  box-shadow: var(--shadow-soft);
}

.build-steps li.active::before {
  content: '●';
  color: var(--accent);
  animation: pulse-step 1.5s infinite;
}

@keyframes pulse-step {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

.build-steps li.done {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  opacity: 0.8;
}

.build-steps li.done::before {
  content: '✓';
  color: var(--muted);
  font-weight: 900;
}

.build-steps li.complete {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent-light);
}

.build-steps li.complete::before {
  content: '✓';
  color: var(--accent-dark);
  font-weight: 900;
}

/* Custom classes injected in actions button */
.actions button.workflow-current:not(:disabled),
.actions button.workflow-complete:not(:disabled),
.actions a.workflow-complete {
  opacity: 1;
  border-color: var(--accent-dark);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.actions button.workflow-dim,
.actions button.workflow-dim:disabled {
  opacity: 0.45;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.actions button.workflow-dim:hover {
  transform: none;
  background: var(--surface-soft);
}

/* Page Selection and Preview Panel Grid */
.preview-panel {
  min-height: 280px;
}

.selection-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.page-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.page-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(16, 185, 129, 0.2);
}

.page-select {
  display: block;
  cursor: pointer;
  position: relative;
  flex-grow: 1;
}

.page-select input {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 20px;
  height: 20px;
}

.page-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-soft);
  transition: var(--transition);
}

.page-tile:hover img {
  opacity: 0.95;
}

.page-select span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
}

.page-tile small {
  font-weight: 600;
  color: var(--muted);
}

.page-tile:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), var(--shadow-soft);
}

.page-asset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.page-asset-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.text-review {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.text-status {
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.text-review textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink);
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  background: #ffffff;
}

/* Associated Images Panel */
.image-panel,
.blueprint-panel {
  grid-column: 1 / -1;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.image-choice {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.image-choice:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(16, 185, 129, 0.2);
}

.image-choice label {
  display: block;
  cursor: pointer;
}

.image-choice input {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 18px;
  height: 18px;
}

.image-choice img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-soft);
  transition: var(--transition);
}

.image-choice-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.image-choice-body strong {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.image-choice-body small {
  font-size: 0.72rem;
  color: var(--muted);
}

.image-choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.pdf-visual-card {
  background: linear-gradient(180deg, #ffffff 0%, rgba(236, 253, 245, 0.7) 100%);
}

.pdf-visual-card::after {
  content: "PDF";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.92);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* Blueprint design cards preview */
.blueprint-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.blueprint-chapter {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--accent);
}

.blueprint-chapter h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--ink);
}

.blueprint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blueprint-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

.blueprint-activities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.blueprint-activity-control {
  display: grid;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg);
  transition: var(--transition-fast);
}

.blueprint-activity-control:hover {
  border-color: var(--accent);
}

.blueprint-activity-control.disabled {
  opacity: 0.5;
}

.blueprint-activity-control.readonly {
  background: var(--surface-soft);
  border-color: var(--line);
}

.blueprint-activity-control strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.blueprint-activity-control em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
}

.activity-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
}

.activity-type-select {
  min-height: 36px;
  padding: 6px 10px;
}

.blueprint-layer-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--bg);
  margin-top: 12px;
}

.blueprint-layer-control.readonly {
  background: var(--surface-soft);
}

.blueprint-layer-control em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
}

.blueprint-page-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.blueprint-page-control {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: var(--transition-fast);
}

.blueprint-page-control:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* File Library list management */
.library-view,
.admin-view {
  padding: 48px 0 72px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.management-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 24px;
}

.management-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  min-width: 0;
}

.management-panel > h2,
.management-panel > p {
  margin-left: 0;
  margin-right: 0;
}

.management-panel > h2 {
  margin-top: 0;
  margin-bottom: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.24rem;
  font-weight: 760;
  color: var(--ink);
}

.management-panel > p {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.admin-grid > .admin-page.active {
  display: flex;
  min-width: 0;
}

.profile-view {
  padding: 48px 0 72px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.profile-dashboard {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.profile-side-panel {
  display: contents;
}

.profile-summary-card {
  grid-column: 1 / -1;
}

.profile-side-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 14px;
}

.profile-side-nav .rail-section {
  border: 1px solid var(--rail-group-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--rail-group-bg);
  box-shadow: var(--shadow-sm);
}

.profile-summary-card,
.profile-settings-card {
  padding: 28px;
}

.profile-summary-card {
  display: grid;
  grid-template-columns: auto minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: 24px;
  align-items: center;
  text-align: left;
  border-left: 0;
  border-top: 5px solid var(--accent);
}

.profile-side-nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.profile-side-nav button:hover,
.profile-side-nav button.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: rgba(16, 185, 129, 0.25);
  transform: none;
}

.profile-side-nav .profile-workflow-link {
  color: var(--ink);
  font-weight: 800;
  border-color: rgba(16, 185, 129, 0.24);
}

.feature-locked {
  opacity: 0.62;
  filter: grayscale(0.35);
}

.feature-locked::after {
  content: "Upgrade";
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid rgba(12, 120, 95, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
}

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

.profile-page:not(.active) {
  display: none !important;
}

.profile-photo-picker {
  display: grid;
  justify-items: center;
  gap: 10px;
  cursor: pointer;
}

.profile-photo-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-photo {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.2);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
}

.profile-photo-action {
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-summary-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
}

.profile-summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  text-align: left;
}

.profile-facts div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.profile-facts dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.profile-upgrade-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(240, 249, 255, 0.78));
  box-shadow: var(--shadow-soft);
}

.profile-upgrade-card h4 {
  margin: 10px 0 6px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.12rem;
  font-weight: 850;
}

.profile-upgrade-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.profile-upgrade-actions button {
  white-space: nowrap;
}

.profile-settings-card {
  display: grid;
  gap: 16px;
}

.profile-settings-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.profile-form,
.profile-readonly-grid {
  display: grid;
  gap: 16px;
}

.profile-readonly-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-options .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-weight: 650;
}

.settings-options .checkbox-row input {
  width: auto;
  margin-top: 3px;
}

.settings-options .checkbox-row span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-file-list {
  display: grid;
  gap: 12px;
}

.profile-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.source-file-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.source-file-badge {
  display: inline-grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  height: 54px;
  border: 1.5px solid rgba(203, 213, 225, 0.9);
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #0f766e;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.source-file-badge::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 15px;
  height: 15px;
  border-left: 1.5px solid rgba(203, 213, 225, 0.9);
  border-bottom: 1.5px solid rgba(203, 213, 225, 0.9);
  background: rgba(226, 232, 240, 0.75);
  border-radius: 0 10px 0 7px;
}

.source-file-badge-pdf { color: #b91c1c; }
.source-file-badge-doc { color: #1d4ed8; }
.source-file-badge-ppt { color: #c2410c; }
.source-file-badge-image { color: #7c3aed; }
.source-file-badge-text { color: #334155; }
.source-file-badge-video { color: #0f766e; }
.source-file-badge-audio { color: #be185d; }
.source-file-badge-caption { color: #0369a1; }
.source-file-badge-h5p {
  color: #047857;
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
  border-color: rgba(16, 185, 129, 0.32);
}

.reused-source-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.9), rgba(255, 255, 255, 0.96));
}

.reused-source-context[hidden] {
  display: none;
}

.reused-source-context strong,
.reused-source-context small,
.reused-source-context p {
  display: block;
}

.reused-source-context strong {
  color: var(--ink);
  font-weight: 850;
}

.reused-source-context small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.reused-source-context p {
  margin: 6px 0 0;
  color: var(--accent-strong);
  font-size: 0.9rem;
  line-height: 1.45;
}

.file-log-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.file-log-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-file-card strong,
.profile-file-card small,
.profile-file-card p {
  display: block;
}

.profile-file-card strong {
  color: var(--ink);
  font-weight: 800;
}

.profile-file-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 650;
}

.profile-file-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.profile-file-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.profile-icon-action {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.log-list {
  display: grid;
  gap: 12px;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.log-item:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-soft);
}

.log-item strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

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

.log-item-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.log-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.generated-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.generated-file-actions a,
.generated-file-actions button {
  font-weight: 800;
  color: var(--accent-dark);
  text-decoration: none;
}

.generated-file-actions button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.generated-file-actions a:hover,
.generated-file-actions button:hover {
  text-decoration: underline;
}

.compact-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 12px;
}

/* Built-in H5P package viewer */
.viewer-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.9), rgba(248, 250, 252, 0.95)),
    var(--bg);
}

.viewer-nav {
  position: sticky;
  top: 0;
  z-index: 100;
}

.viewer-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 28px auto 72px;
  display: grid;
  gap: 22px;
}

.viewer-tabs {
  display: inline-flex;
  width: max-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.viewer-tabs button {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.viewer-tabs button.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.22);
}

.viewer-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-left: 8px solid var(--accent);
}

.viewer-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.viewer-sidebar {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 14px;
}

.viewer-sidebar h2,
.viewer-content h2 {
  margin: 0;
}

.viewer-toc {
  display: grid;
  gap: 8px;
}

.viewer-toc a,
.viewer-toc button {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.viewer-toc button span {
  display: block;
  color: var(--accent-dark);
  font-size: 0.8rem;
}

.viewer-toc a:hover,
.viewer-toc button:hover {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-dark);
}

.viewer-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.viewer-mode-video .viewer-layout,
.viewer-mode-slider .viewer-layout,
.viewer-mode-runtime .viewer-layout {
  grid-template-columns: minmax(0, 1fr);
}

.viewer-mode-video .viewer-sidebar,
.viewer-mode-slider .viewer-sidebar,
.viewer-mode-runtime .viewer-sidebar {
  display: none;
}

.viewer-mode-video .viewer-shell,
.viewer-mode-slider .viewer-shell,
.viewer-mode-runtime .viewer-shell {
  width: min(1240px, calc(100% - 40px));
  margin-top: 28px;
}

.viewer-mode-video .viewer-hero,
.viewer-mode-slider .viewer-hero {
  padding: 12px 16px;
  border-left-width: 4px;
  box-shadow: none;
}

.viewer-mode-video .viewer-hero h1,
.viewer-mode-slider .viewer-hero h1 {
  font-size: 1.25rem;
  margin: 0;
}

.viewer-mode-video .viewer-hero .eyebrow,
.viewer-mode-video .viewer-hero p,
.viewer-mode-slider .viewer-hero .eyebrow,
.viewer-mode-slider .viewer-hero p {
  display: none;
}

.viewer-mode-video .viewer-content,
.viewer-mode-slider .viewer-content,
.viewer-mode-runtime .viewer-content {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.viewer-edit-active .viewer-hero {
  display: flex;
}

.viewer-editor-panel {
  display: grid;
  gap: 18px;
}

.viewer-editor-panel[hidden] {
  display: none;
}

.viewer-editor-shell {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.viewer-editor-shell h2 {
  margin: 4px 0 8px;
}

.viewer-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.viewer-editor-canvas {
  display: grid;
  gap: 16px;
}

.h5p-editor-frame {
  width: 100%;
  min-height: 82vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.editor-runtime-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.9), #ffffff);
}

.editor-runtime-card h3,
.editor-runtime-card h4 {
  margin: 0;
}

.editor-runtime-card ul {
  margin: 0;
  padding-left: 22px;
}

.editor-runtime-card code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
}

.h5p-standalone-player {
  width: min(100%, 1180px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.h5p-standalone-player iframe,
.h5p-standalone-player .h5p-iframe {
  width: 100%;
  min-height: 76vh;
  border: 0;
}

.h5p-standalone-player .h5p-iframe-wrapper {
  min-height: 76vh;
}

.viewer-canvas {
  display: grid;
  gap: 20px;
}

.scorm-preview-panel {
  width: 100%;
  max-width: none;
  min-height: 86vh;
  padding: 16px;
  box-sizing: border-box;
  overflow: visible;
}

.scorm-launch-frame {
  display: block;
  width: 100%;
  height: clamp(760px, 86vh, 1180px);
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 760px) {
  .scorm-preview-panel {
    padding: 10px;
  }

  .scorm-launch-frame {
    height: 86vh;
    min-height: 680px;
  }
}

.viewer-chapter {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.viewer-chapter > h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.viewer-activity,
.viewer-param-group,
.viewer-text-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.82);
  min-width: 0;
}

.viewer-column {
  background: #ffffff;
}

.viewer-activity-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 800;
  color: var(--ink);
}

.viewer-activity-heading small {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-dark);
  white-space: nowrap;
}

.viewer-text-block h4,
.viewer-param-group h4 {
  margin: 0;
  color: var(--muted);
  text-transform: capitalize;
}

.viewer-rich-text {
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.viewer-rich-text > :first-child {
  margin-top: 0;
}

.viewer-rich-text > :last-child {
  margin-bottom: 0;
}

.viewer-image {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.viewer-image img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
}

.viewer-image figcaption {
  color: var(--muted);
  font-size: 0.88rem;
}

.viewer-list {
  display: grid;
  gap: 10px;
}

.h5p-player {
  display: grid;
  gap: 18px;
}

.h5p-video-player {
  padding: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.h5p-video-stage {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #020617;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.h5p-video-stage video,
.h5p-video-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #020617;
}

.viewer-empty-player {
  padding: 28px;
  color: #cbd5e1;
  text-align: center;
}

.h5p-video-cuebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 34px;
  background: rgba(17, 17, 17, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.h5p-video-cuebar::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.h5p-video-cuebar button {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #262626;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
}

.h5p-video-cuebar button:hover,
.h5p-video-cuebar button:focus-visible {
  width: 12px;
  height: 12px;
  background: var(--accent);
  outline: none;
}

.viewer-interaction-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.h5p-video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(2, 6, 23, 0.48);
  z-index: 5;
}

.h5p-video-overlay[hidden] {
  display: none;
}

.h5p-video-overlay-card {
  width: min(760px, 96%);
  max-height: min(82vh, 92%);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.h5p-video-overlay-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.h5p-video-overlay-top strong {
  color: var(--accent-dark);
}

.h5p-video-overlay-top button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
}

#viewerInteractionPanel {
  padding: 16px;
}

.viewer-interaction-card h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.viewer-answer-list {
  display: grid;
  gap: 10px;
}

.viewer-answer-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}

.viewer-answer-list button:hover,
.viewer-answer-list button.selected {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(209, 250, 229, 0.42);
}

.viewer-answer-list button span {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-dark);
}

.viewer-check-result {
  margin: 0;
  font-weight: 800;
  color: var(--muted);
}

.viewer-check-result.correct {
  color: var(--accent-dark);
}

.viewer-check-result.incorrect {
  color: #b91c1c;
}

.viewer-blank-input {
  width: min(220px, 100%);
  margin: 0 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.viewer-mini-question {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.viewer-rich-text mark {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.28);
}

.h5p-slider-player {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.h5p-slider-frame {
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.h5p-slider-frame .viewer-image {
  width: 100%;
  border: 0;
  background: transparent;
}

.h5p-slider-frame .viewer-image img {
  max-height: 76vh;
}

.h5p-slider-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.h5p-slider-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.h5p-slider-thumbs button {
  padding: 6px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
}

.h5p-slider-thumbs button.active {
  border-color: var(--accent);
}

.h5p-slider-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  display: block;
}

@media (max-width: 900px) {
  .viewer-shell {
    width: min(100% - 24px, 760px);
  }

  .viewer-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-actions {
    justify-content: flex-start;
  }

  .viewer-layout {
    grid-template-columns: 1fr;
  }

  .viewer-sidebar {
    position: static;
  }

  .h5p-video-overlay {
    padding: 10px;
  }
}

/* Admin Dashboard Panel layout */
.admin-dashboard {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 0;
}

.admin-side-nav {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.admin-nav-title {
  display: grid;
  gap: 2px;
  padding: 6px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.admin-side-nav .rail-section {
  gap: 6px;
  border: 1px solid var(--rail-group-border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--rail-group-bg);
}

.admin-side-nav .rail-section:last-child {
  border-bottom: 1px solid var(--rail-group-border);
  padding-bottom: 10px;
}

.admin-nav-title span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ink);
}

.admin-nav-title small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-side-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
  box-shadow: none;
  text-align: left;
  justify-content: flex-start;
}

.admin-side-nav button:hover,
.admin-side-nav button:focus,
.admin-side-nav button.active {
  background: var(--surface-soft);
  color: var(--ink);
  transform: translateX(2px);
}

.admin-side-nav button.active {
  border-color: rgba(16, 185, 129, 0.18);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.admin-content {
  display: grid;
  gap: 32px;
  min-width: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.admin-inline-form input,
.admin-inline-form select {
  flex: 1 1 180px;
  min-width: 140px;
}

.admin-inline-form button {
  min-width: 42px;
}

.password-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: #ffffff;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}

.password-form input {
  flex: 1 1 180px;
}

/* User Management Table Grid */
.admin-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.admin-table-wrap:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.24);
  outline-offset: 3px;
}

.admin-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  vertical-align: middle;
  text-align: left;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 260px;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 105px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 105px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 140px;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
  width: 250px;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 85px;
  text-align: center;
}

.admin-table th:nth-child(7),
.admin-table td:nth-child(7) {
  width: 130px;
}

.admin-table th:nth-child(8),
.admin-table td:nth-child(8) {
  width: 92px;
}

.user-management-table th:first-child,
.user-management-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 12px 0 20px -22px rgba(15, 23, 42, 0.75);
}

.user-management-table th:first-child {
  z-index: 4;
  background: var(--surface-soft);
}

.user-management-table th:last-child,
.user-management-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #ffffff;
  box-shadow: -12px 0 20px -22px rgba(15, 23, 42, 0.75);
}

.user-management-table th:last-child {
  z-index: 5;
  background: var(--surface-soft);
}

.admin-table th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-soft);
  border-bottom: 1.5px solid var(--line);
}

.admin-table td {
  border-bottom: 1px solid var(--line);
}

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

.admin-table tr:hover td {
  background: rgba(248, 250, 252, 0.5);
}

.admin-table td strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.admin-table .password-note {
  color: var(--warning);
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 250, 0.9);
}

.admin-filter-bar label {
  display: grid;
  gap: 6px;
}

.admin-filter-bar span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-filter-bar input,
.admin-filter-bar select {
  min-height: 38px;
  padding: 8px 11px;
}

.empty-table-message {
  color: var(--muted);
  font-weight: 700;
  text-align: center !important;
}

.user-identity-editor {
  display: grid;
  gap: 7px;
}

.user-identity-editor label {
  display: block;
}

.user-identity-editor .user-row-input {
  width: 100%;
  min-width: 0;
  font-size: 0.86rem;
}

.user-identity-editor .user-row-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  color: var(--ink);
}

.user-identity-editor .user-row-email {
  color: var(--muted);
}

.user-demo-note {
  color: var(--accent-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table select,
.admin-table input {
  min-height: 36px;
  padding: 6px 12px;
  max-width: 100%;
}

.admin-table .quota-input {
  width: 80px;
}

.user-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 0.78rem;
}

.user-feature-list label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  line-height: 1.2;
}

.user-feature-list input {
  min-height: 16px;
  width: 16px;
  padding: 0;
}

/* Status tags badges */
.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 99px;
  padding: 2px 10px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 750;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-tag.suspended {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.status-tag.deleted {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--line);
}

/* Form panel toggle and inline grids */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin-only:not(.unlocked) {
  position: relative;
}

.admin-only:not(.unlocked)::after {
  content: "Admin login required";
  position: absolute;
  inset: auto 24px 24px 24px;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.admin-only:not(.unlocked) input,
.admin-only:not(.unlocked) select {
  pointer-events: none;
  opacity: 0.5;
}

.locked-panel:not(.unlocked) {
  position: relative;
}

.locked-panel:not(.unlocked)::after {
  content: "Admin login required";
  position: absolute;
  inset: auto 24px 24px 24px;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.locked-panel:not(.unlocked) input,
.locked-panel:not(.unlocked) select {
  pointer-events: none;
  opacity: 0.5;
}

/* System Facts List */
.system-facts {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
  gap: 12px 20px;
  margin: 10px 0 0;
}

.system-facts dt {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.system-facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}

/* Access Model cards */
.access-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.access-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-soft);
}

.access-grid article strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--bg-dark);
}

.access-grid article p {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

/* native Table Icons Actions styling */
.table-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, 34px);
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.subscription-plan-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

.subscription-plan-form input,
.subscription-plan-form textarea {
  width: 100%;
}

.subscription-plan-form textarea {
  min-height: 84px;
  resize: vertical;
}

.subscription-plan-form .switch-row,
.subscription-plan-form .actions {
  grid-column: 1 / -1;
}

.muted-row {
  opacity: 0.62;
}

.trial-not-applicable {
  display: block;
  min-height: 1.2em;
}

.icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-action.primary {
  color: #ffffff;
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.icon-action.primary:hover {
  color: #ffffff;
  background: #065f46;
  border-color: #065f46;
}

.icon-action.soft {
  color: var(--accent-dark);
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(236, 253, 245, 0.92);
}

.icon-action.soft:hover {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(209, 250, 229, 0.95);
}

.icon-action.warning {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(255, 251, 235, 0.95);
}

.icon-action.warning:hover {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.46);
  background: #fef3c7;
}

.icon-action:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

.icon-action.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.icon-action.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.icon-action.purge-action {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.32);
  background: rgba(254, 242, 242, 0.98);
}

.icon-action.purge-action:hover {
  color: #ffffff;
  border-color: #991b1b;
  background: #b91c1c;
}

.icon-action:disabled,
.icon-action:disabled:hover {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  color: var(--muted);
  border-color: var(--line);
  background: #f8fafc;
}

.plan-icon-action {
  border-radius: 12px;
}

.icon-action__glyph,
.icon-action__glyph svg,
.icon-action > svg {
  display: block;
  width: 16px;
  height: 16px;
}

.icon-action__glyph svg,
.icon-action > svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Modals Dialog boxes */
.auth-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg), 0 30px 60px -15px rgba(15, 23, 42, 0.3);
  background: #ffffff;
  overflow: hidden;
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  animation: fadeInBackdrop 0.2s ease-out forwards;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 36px 32px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  box-sizing: border-box;
  transform: none;
  will-change: auto;
}

.auth-card input,
.auth-card select,
.auth-card textarea,
.checkout-dialog input,
.checkout-dialog select,
.checkout-dialog textarea {
  box-shadow: none;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus,
.checkout-dialog input:focus,
.checkout-dialog select:focus,
.checkout-dialog textarea:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

#signupDialog {
  width: min(640px, calc(100% - 32px));
}

#signupForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 14px;
}

#signupForm > .dialog-close,
#signupForm > .eyebrow,
#signupForm > h2,
#signupForm > p,
#signupForm > label:has(textarea),
#signupForm > #signupStatus,
#signupForm > button[type="submit"] {
  grid-column: 1 / -1;
}

.user-action-dialog {
  width: min(820px, calc(100% - 32px));
}

#addUserDialog {
  width: min(1120px, calc(100vw - 48px));
}

.user-action-card {
  gap: 18px;
}

.add-user-card {
  width: 100%;
  padding: 30px;
  overflow-x: hidden;
}

.popup-control-box {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fbfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.popup-inline-form {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  margin: 0;
}

#adminAddUserForm.popup-inline-form {
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 1.15fr) minmax(160px, 0.8fr) minmax(190px, 0.95fr) 64px;
}

#resetAdminPasswordForm.popup-inline-form {
  grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) 64px minmax(280px, 1.35fr);
}

.popup-inline-form input,
.popup-inline-form select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border-radius: 14px;
  background: #ffffff;
  font-size: 1rem;
}

.popup-inline-form .admin-icon-command {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(5, 150, 105, 0.22);
}

.popup-inline-form .settings-note {
  min-height: 54px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-dark);
  font-weight: 700;
}

.popup-inline-form .settings-note.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(254, 242, 242, 0.92);
  color: var(--danger);
}

.admin-password-status:empty {
  display: none;
}

.user-action-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-action-heading .profile-avatar {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  flex: 0 0 auto;
}

.user-action-heading h2 {
  margin: 0;
}

.user-action-heading p {
  margin: 4px 0 0;
}

.modal-tabs {
  display: inline-flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  overflow-x: auto;
}

.modal-tabs button {
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.modal-tabs button.active {
  background: var(--accent);
  color: #ffffff;
}

.modal-tab-panel {
  display: none;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 250, 0.72);
}

.modal-tab-panel.active {
  display: block;
}

.user-modal-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-modal-feature-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.user-modal-feature-list input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.user-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-action-grid button {
  justify-content: center;
  min-height: 46px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.warning-button {
  color: #9a5b00;
  border-color: rgba(245, 158, 11, 0.45);
  background: #fffbeb;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}

.login-brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.login-brand span {
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
}

.auth-card h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.auth-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.auth-card textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  z-index: 100;
  transition: var(--transition-fast);
}

.dialog-close:hover {
  transform: rotate(90deg) scale(1.05);
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* Checkout Dialog boxes */
.checkout-dialog {
  width: min(580px, calc(100% - 32px));
}

.cart-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cart-summary > div,
.paypal-checkout-box,
.contact-checkout-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.cart-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cart-summary strong {
  display: block;
  margin-top: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.checkout-features {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding-left: 20px;
  list-style-type: none;
}

.checkout-features li {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
}

.checkout-features li::before {
  content: '✓';
  position: absolute;
  left: -20px;
  color: var(--accent-dark);
  font-weight: 900;
}

#paypalButtonContainer {
  min-height: 48px;
  margin-top: 12px;
}

/* Main Site Footer details */
.site-footer {
  border-top: 1px solid var(--line);
  background: #0f172a;
  color: #f1f5f9;
  position: relative;
}

.footer-grid-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
}

.site-footer .brand-mark,
.site-footer .footer-contact,
.site-footer .footer-contact a {
  color: #ffffff;
}

.site-footer .brand-symbol {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.site-footer p,
.site-footer small {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-brand {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-bottom-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.footer-contact a {
  font-weight: 600;
  text-decoration: underline;
  transition: var(--transition-fast);
}

.footer-contact a:hover {
  color: var(--accent);
}

/* Contact View Page */
.contact-view {
  padding: 48px 0 72px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.contact-page-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(360px, 1.2fr);
  gap: 40px;
  margin-top: 32px;
  align-items: start;
}

.contact-info-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--accent);
}

.contact-info-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--bg-dark);
  margin: 0 0 14px;
}

.contact-info-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 24px;
}

.contact-details-list {
  display: grid;
  gap: 20px;
}

.detail-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.detail-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(16, 185, 129, 0.15);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.detail-item strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.detail-item p {
  margin: 0;
  font-size: 0.9rem;
}

.detail-item a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.detail-item a:hover {
  text-decoration: underline;
}

/* Contact Form Overrides for Page */
.contact-view .contact-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.contact-view .contact-form h2 {
  color: var(--ink);
}

.contact-view .contact-form input,
.contact-view .contact-form textarea {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.contact-view .contact-form input:focus,
.contact-view .contact-form textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.small-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 500;
}

.small-status.error {
  color: var(--danger);
}

/* Media/Video Studio Subpage specific CSS overrides */
.app-shell {
  min-height: 100vh;
  padding: 40px;
  width: min(1360px, 100%);
  margin: 0 auto;
}

.media-workspace {
  width: 100%;
}

.media-dashboard {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.media-rail {
  position: sticky;
  top: 96px;
}

.media-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: start;
}

.media-layout > .panel:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.media-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.media-field {
  display: grid;
  gap: 8px;
}

.media-field.wide {
  grid-column: 1 / -1;
}

.media-field input[type="file"],
.media-field textarea {
  width: 100%;
  background: #ffffff;
}

.media-field textarea {
  min-height: 100px;
}

.media-field[hidden] {
  display: none;
}

.media-url-assist {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(236, 253, 245, 0.78);
}

.media-url-assist[hidden] {
  display: none;
}

.media-url-assist__header,
.media-url-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-url-assist__header {
  justify-content: space-between;
}

.media-url-search-row {
  flex-wrap: wrap;
}

.media-url-search-row input {
  min-width: min(100%, 280px);
  flex: 1;
}

.requirement-note {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.5;
}

.media-actions {
  margin-top: 16px;
}

/* Video Authoring workbench */
.video-author-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(360px, 0.8fr);
  gap: 24px;
}

.transcript-page-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.video-preview-mount {
  min-width: 0;
}

.transcript-tools {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.video-preview-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.video-preview-column:not(.editing-active) .studio-timeline,
.video-preview-column:not(.editing-active) .edit-lists {
  display: none;
}

.studio-monitor-header,
.studio-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.studio-monitor-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.studio-monitor-header strong {
  min-width: 0;
  max-width: 60%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-preview-shell {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border: 8px solid #101827;
  border-radius: 14px;
  overflow: hidden;
  background: #04070d;
  box-shadow: var(--shadow-lg);
}

.video-preview-shell video,
.video-preview-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000000;
  object-fit: contain;
}

.youtube-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(180px, 40%) minmax(220px, 1fr);
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(9, 13, 22, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
  color: #ffffff;
}

.youtube-fallback img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.youtube-fallback strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.youtube-fallback p {
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.youtube-fallback .secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 32px;
}

.youtube-fallback .secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

#videoPlaceholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #94a3b8;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #090d16 100%);
  font-weight: 500;
  font-size: 0.95rem;
}

.preview-edit-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr)) auto;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.preview-edit-bar button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.78rem;
  white-space: normal;
}

.preview-edit-bar button::before {
  font-size: 1rem;
}

.preview-edit-status {
  align-self: center;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.studio-timeline {
  display: grid;
  grid-template-columns: 0.65fr 1fr 0.8fr 1.2fr;
  gap: 4px;
  overflow: hidden;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.studio-timeline span {
  min-width: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #d7f7eb 0%, #b7e7d5 100%);
}

.studio-timeline span:nth-child(2) {
  background: linear-gradient(180deg, #e7eef8 0%, #c8d4e5 100%);
}

.studio-timeline span:nth-child(3) {
  background: linear-gradient(180deg, #fff4cf 0%, #f6d986 100%);
}

.studio-timeline span:nth-child(4) {
  background: linear-gradient(180deg, #dbeafe 0%, #b8cdf2 100%);
}

/* Video Range Editor workbench */
.video-edit-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.video-edit-studio {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef7f3 100%);
  box-shadow: var(--shadow-sm);
}

.video-edit-controls {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.studio-tools-header {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(160px, 1fr);
  align-items: start;
}

.studio-tools-header h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.08rem;
}

.studio-tools-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.video-edit-controls .inline-tools {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.video-edit-controls .inline-tools button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.video-edit-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.edit-range-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: flex-end;
  gap: 10px;
}

.range-inputs button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.split-inputs {
  grid-template-columns: minmax(0, 1fr);
}

.edit-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 0;
  align-items: start;
}

.edit-lists h3 {
  margin: 0 0 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
}

.range-list,
.split-segments {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.range-list li,
.segment-choice {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.edit-lists button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.segment-choice {
  justify-content: flex-start;
  cursor: pointer;
}

.range-list .empty-range {
  justify-content: flex-start;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 500;
  border-style: dashed;
}

.inline-tools,
.cue-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.transcript-tools .inline-tools button {
  min-width: 0;
  white-space: normal;
}

.transcription-language-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: var(--radius-md);
  background: rgba(236, 253, 245, 0.58);
}

.transcription-language-panel > div {
  grid-column: 1 / -1;
  min-width: 0;
}

.transcription-language-panel strong {
  display: block;
  color: var(--accent-dark);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.transcription-language-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.transcription-language-panel label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.transcription-language-panel label span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.transcription-language-panel select {
  min-width: 0;
}

.cue-toolbar label {
  width: min(160px, 100%);
}

#transcriptText {
  min-height: 280px;
  line-height: 1.5;
  font-family: inherit;
  font-size: 0.9rem;
}

.media-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.media-progress progress {
  height: 10px;
}

/* Cue table styling */
.cue-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.cue-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  background: #ffffff;
}

.cue-table th,
.cue-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  vertical-align: top;
  text-align: left;
}

.cue-table th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-soft);
}

.cue-table tr:hover td {
  background: rgba(248, 250, 252, 0.4);
}

.cue-table input,
.cue-table select,
.cue-table textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.cue-table textarea {
  min-height: 60px;
  resize: vertical;
}

/* Interactive Video Workbench inline dynamic additions */
.video-edit-inline {
  margin-top: 16px;
}

.video-edit-inline .panel-header {
  margin-bottom: 12px;
}

.video-edit-inline .video-edit-layout,
.video-edit-inline .edit-lists {
  grid-template-columns: 1fr;
}

.video-edit-inline .range-inputs {
  grid-template-columns: repeat(2, minmax(90px, 1fr)) repeat(2, auto);
}

.video-edit-inline .split-inputs {
  grid-template-columns: minmax(110px, 1fr) auto auto;
}

/* Tablet breakpoint for feature grid */
@media (max-width: 1100px) and (min-width: 881px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive breakdowns */
@media (max-width: 880px) {
  .backdrop-gradient {
    display: none;
  }
  
  .site-nav {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 20px;
    gap: 16px;
    text-align: left;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-links,
  .account-actions,
  .portal-language-switch {
    display: none;
    grid-column: 1 / -1;
    justify-content: stretch;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .site-nav.nav-open .nav-links,
  .site-nav.nav-open .account-actions,
  .site-nav.nav-open .portal-language-switch {
    display: flex;
  }

  .nav-links button,
  .nav-links a,
  .account-actions button,
  .account-actions a,
  .portal-language-switch,
  .portal-language-switch select {
    width: 100%;
    max-width: none;
  }

  .hero {
    min-height: 60vh;
    padding: 30px 0;
  }

  .hero-overlay {
    padding: 24px;
  }

  .feature-grid,
  .pricing-grid,
  .split-band,
  .management-grid,
  .admin-grid,
  .access-grid,
  .footer-grid-simple,
  .contact-page-grid,
  .profile-dashboard,
  .profile-readonly-grid,
  .profile-file-card,
  .contact-fields,
  .admin-form-grid,
  .admin-inline-form,
  .admin-dashboard,
  .media-dashboard,
  .media-layout,
  .creator-view.active {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .dashboard-rail {
    position: static;
  }

  .admin-side-nav {
    position: static;
  }

  .profile-side-panel {
    display: grid;
    gap: 16px;
  }

  .profile-side-nav {
    position: static;
  }

  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .user-management-table,
  .user-management-table thead,
  .user-management-table tbody,
  .user-management-table tr,
  .user-management-table th,
  .user-management-table td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }

  .user-management-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .user-management-table thead {
    position: absolute;
    width: 1px !important;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .user-management-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .user-management-table th:first-child,
  .user-management-table td:first-child,
  .user-management-table th:last-child,
  .user-management-table td:last-child {
    position: static;
    box-shadow: none;
  }

  .user-management-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .user-management-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .user-management-table td.table-actions {
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    justify-content: stretch;
  }

  .user-management-table .table-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, 34px);
  }

  .user-action-heading {
    align-items: flex-start;
  }

  .modal-tabs {
    width: 100%;
  }

  .modal-tabs button {
    flex: 1 0 auto;
  }

  .user-modal-feature-list,
  .user-action-grid {
    grid-template-columns: 1fr;
  }

  #addUserDialog {
    width: min(100%, calc(100vw - 20px));
  }

  .add-user-card {
    width: 100%;
    padding: 22px 18px;
  }

  .popup-control-box {
    padding: 14px;
  }

  #adminAddUserForm.popup-inline-form,
  #resetAdminPasswordForm.popup-inline-form {
    grid-template-columns: 1fr;
  }

  .popup-inline-form .admin-icon-command,
  .popup-inline-form .settings-note {
    width: 100%;
  }

  .profile-summary-card {
    grid-column: auto;
    grid-template-columns: 1fr !important;
    text-align: center;
  }

  .profile-facts {
    grid-template-columns: 1fr;
  }

  .profile-upgrade-card,
  .profile-upgrade-actions {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .profile-upgrade-actions button {
    width: 100%;
  }

  .workflow-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .app-shell {
    padding: 20px;
  }

  .topbar,
  .layout,
  .video-author-grid,
  .video-edit-workbench,
  .transcript-page-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .preview-edit-bar,
  .video-edit-layout,
  .edit-lists,
  .transcription-language-panel {
    grid-template-columns: 1fr;
  }

  .transcription-language-panel > div {
    grid-column: auto;
  }

  .status-pill,
  .settings-panel,
  .result-panel {
    margin-top: 0;
    width: 100%;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .media-editor-grid {
    grid-template-columns: 1fr;
  }

  .build-steps {
    grid-template-columns: 1fr;
  }

  .dropzone {
    min-height: 180px;
  }
  
  .cart-summary {
    grid-template-columns: 1fr;
  }
  
  .dialog-close {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
  }

  .auth-card {
    padding: 32px 20px 24px;
  }

  #signupForm {
    grid-template-columns: 1fr;
  }

  .footer-grid-simple {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 16px;
  }
  
  .footer-bottom-info {
    align-items: center;
    text-align: center;
  }
}

/* Final shared workflow overrides */
.workflow-page-footer,
.viewer-tabs,
.studio-switch-strip,
.simulation-actions {
  border: 1px solid rgba(203, 213, 225, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 35px -25px rgba(15, 23, 42, 0.35);
}

.workflow-page-footer {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.page-progress-line {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.82), rgba(239, 246, 255, 0.82));
}

.page-progress-line progress {
  width: 100%;
  min-width: 120px;
  accent-color: var(--accent);
}

.page-progress-line span {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.82rem;
  text-align: right;
}

.file-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
}

.file-group + .file-group {
  margin-top: 10px;
}

.file-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 8px;
  color: var(--ink);
}

.file-group-heading strong {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-group-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 850;
}

.notification-item.unread {
  border-color: rgba(16, 185, 129, 0.36);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.86), #ffffff);
}

@media (max-width: 820px) {
  .page-progress-line {
    grid-template-columns: 1fr;
  }

  .page-progress-line span {
    text-align: left;
  }
}

/* Moodle embedded lab mode keeps the workflow visible without the public portal chrome. */
html.moodle-embedded body {
  background: #f8fffc;
}

html.moodle-embedded .site-nav,
html.moodle-embedded .backdrop-gradient,
html.moodle-embedded .hero,
html.moodle-embedded .home-band,
html.moodle-embedded .modal-backdrop,
html.moodle-embedded .site-footer {
  display: none !important;
}

html.moodle-embedded .platform-shell {
  min-height: auto;
}

html.moodle-embedded main,
html.moodle-embedded .app-shell,
html.moodle-embedded .media-dashboard {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  max-width: none;
}

html.moodle-embedded .creator-view.active,
html.moodle-embedded .media-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

html.moodle-embedded .creator-view.active {
  padding: 0;
}

html.moodle-embedded .dashboard-rail,
html.moodle-embedded .media-rail {
  position: static !important;
  top: auto !important;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin: 0 0 12px;
  z-index: auto;
}

html.moodle-embedded .dashboard-rail .rail-card,
html.moodle-embedded .dashboard-rail .quota-card {
  display: none !important;
}

html.moodle-embedded .dashboard-rail > .rail-section,
html.moodle-embedded .media-rail > .rail-section {
  display: flex;
  flex: 1 1 260px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html.moodle-embedded .rail-section-title {
  flex: 0 0 100%;
}

html.moodle-embedded .rail-link {
  width: auto;
  min-height: 42px;
  padding: 10px 12px;
}

html.moodle-embedded .creator-intro,
html.moodle-embedded .workspace,
html.moodle-embedded .panel,
html.moodle-embedded .media-workspace,
html.moodle-embedded .media-author-panel {
  border-radius: 16px;
}

html.moodle-embedded .creator-intro,
html.moodle-embedded .topbar {
  margin-top: 0;
}

html.moodle-embedded .workspace,
html.moodle-embedded .media-workspace {
  width: 100%;
  min-width: 0;
}
