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


/* ================================================================
   BACKBONE MEDIA LIBRARY — DESIGN SYSTEM
   World-Class Media Library & Archive Manager
   ================================================================ */
/* ── Custom Properties ──────────────────────────────────────────── */
:root {
  /* Primary accent – amber/gold matching Hub orange #FFA000 */
  --ml-accent: #FFA000;
  --ml-accent-light: #FFB740;
  --ml-accent-dark: #E08F00;
  --ml-accent-glow: rgba(255, 160, 0, 0.25);

  /* Surface colors – dark mode native */
  --ml-bg-deep: #0A0A0F;
  --ml-bg-surface: #111118;
  --ml-bg-elevated: #1A1A24;
  --ml-bg-card: #16161F;
  --ml-bg-card-hover: #1E1E2A;

  /* Glass */
  --ml-glass-bg: rgba(22, 22, 31, 0.75);
  --ml-glass-border: rgba(255, 255, 255, 0.08);
  --ml-glass-highlight: rgba(255, 255, 255, 0.04);
  --ml-glass-blur: 16px;

  /* Text */
  --ml-text-primary: #F0F0F5;
  --ml-text-secondary: #8E8EA0;
  --ml-text-muted: #555566;

  /* Media type colors */
  --ml-type-video: #22D3EE;
  --ml-type-audio: #A855F7;
  --ml-type-image: #F59E0B;
  --ml-type-document: #34D399;
  --ml-type-archive: #F472B6;
  --ml-type-other: #64748B;

  /* Cloud provider colors */
  --ml-cloud-google: #E91E63;
  --ml-cloud-box: #0061D5;
  --ml-cloud-dropbox: #9C27B0;
  --ml-cloud-firebase: #00CED1;
  --ml-cloud-local: #4CAF50;

  /* Gradients */
  --ml-gradient-accent: linear-gradient(135deg, #FFA000 0%, #FF6D00 100%);
  --ml-gradient-card: linear-gradient(145deg, rgba(26, 26, 36, 0.9) 0%, rgba(16, 16, 24, 0.95) 100%);
  --ml-gradient-shimmer: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);

  /* Shadows */
  --ml-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --ml-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --ml-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --ml-shadow-glow: 0 0 20px var(--ml-accent-glow);

  /* Transitions */
  --ml-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --ml-transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --ml-transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radii */
  --ml-radius-sm: 8px;
  --ml-radius-md: 12px;
  --ml-radius-lg: 16px;
  --ml-radius-xl: 20px;
}
/* ── Light Theme Design System ──────────────────────────────────── */
[data-theme="light"],
:root[data-theme="light"],
html[data-theme="light"] {
  /* Primary accent */
  --ml-accent: #E65100;
  --ml-accent-light: #FF9800;
  --ml-accent-dark: #BF360C;
  --ml-accent-glow: rgba(230, 81, 0, 0.2);

  /* Surface colors – crisp light mode palette */
  --ml-bg-deep: #F8FAFC;
  --ml-bg-surface: #FFFFFF;
  --ml-bg-elevated: #F1F5F9;
  --ml-bg-card: #FFFFFF;
  --ml-bg-card-hover: #F8FAFC;

  /* Glass */
  --ml-glass-bg: rgba(255, 255, 255, 0.9);
  --ml-glass-border: rgba(0, 0, 0, 0.08);
  --ml-glass-highlight: rgba(0, 0, 0, 0.03);
  --ml-glass-blur: 16px;

  /* Text */
  --ml-text-primary: #0F172A;
  --ml-text-secondary: #475569;
  --ml-text-muted: #64748B;

  /* Gradients */
  --ml-gradient-accent: linear-gradient(135deg, #FFA000 0%, #FF6D00 100%);
  --ml-gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  --ml-gradient-shimmer: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.04) 50%, transparent 100%);

  /* Shadows */
  --ml-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --ml-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --ml-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --ml-shadow-glow: 0 0 20px var(--ml-accent-glow);
}
[data-theme="light"] body {
  background-color: var(--ml-bg-deep);
  color: var(--ml-text-primary);
}
[data-theme="light"] .glass-sidebar {
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--ml-glass-border);
}
[data-theme="light"] .glass-card::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 50%,
    transparent 100%
  );
}
[data-theme="light"] .gallery-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .gallery-card:hover {
  border-color: rgba(255, 160, 0, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .gallery-card__thumbnail {
  background: #F1F5F9;
}
[data-theme="light"] .stat-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .stat-card:hover {
  border-color: rgba(255, 160, 0, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .command-palette-backdrop {
  background: rgba(15, 23, 42, 0.45);
}
[data-theme="light"] .command-palette-modal {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 160, 0, 0.2);
}
[data-theme="light"] .command-palette-input {
  color: #0F172A;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .command-palette-item:hover,
[data-theme="light"] .command-palette-item--selected {
  background: rgba(255, 160, 0, 0.12);
  color: #D97706;
}
[data-theme="light"] .dropzone-fullscreen {
  background: rgba(255, 255, 255, 0.88);
  border: 3px dashed var(--ml-accent);
}
[data-theme="light"] .scrubber-track {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .cinema-layout {
  background-color: var(--ml-bg-deep);
  color: var(--ml-text-primary);
}
[data-theme="light"] .cinema-sidebar {
  background: #FFFFFF;
  border-right: 1px solid var(--ml-glass-border);
}
[data-theme="light"] .cinema-inspector {
  background: #FFFFFF;
  border-left: 1px solid var(--ml-glass-border);
}
[data-theme="light"] .search-glass .MuiOutlinedInput-root {
  background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .search-glass .MuiOutlinedInput-root:hover {
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .search-glass .MuiOutlinedInput-root.Mui-focused {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .action-btn {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ml-text-primary);
}
[data-theme="light"] .action-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] * {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
/* ── Base Reset ─────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--ml-bg-deep);
  color: var(--ml-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
#root {
  min-height: 100vh;
}
/* Hub iframe: fill the iframe viewport — avoid body scroll that hides content on wheel */
html.hub-embedded,
html.hub-embedded body,
html.hub-embedded #root {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
html.hub-embedded body {
  overscroll-behavior: none;
}
html.hub-embedded #root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
html.hub-embedded #root > * {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Single scroll region inside Hub iframe — avoids blank repaint on wheel */
.hub-embed-scroll {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* backdrop-filter in nested iframes can blank the layer on scroll (Chrome) */
html.hub-embedded .glass-card,
html.hub-embedded .glass-sidebar,
html.hub-embedded .glass-surface,
html.hub-embedded .search-glass .MuiOutlinedInput-root,
html.hub-embedded .action-btn,
html.hub-embedded .media-badge {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* ── Scrollbar (thin, translucent, visible on hover) ────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transition: background 0.2s;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* ── Glassmorphism Utilities ────────────────────────────────────── */
.glass-card {
  background: var(--ml-glass-bg);
  backdrop-filter: blur(var(--ml-glass-blur));
  -webkit-backdrop-filter: blur(var(--ml-glass-blur));
  border: 1px solid var(--ml-glass-border);
  border-radius: var(--ml-radius-md);
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 50%,
    transparent 100%
  );
  pointer-events: none;
}
.glass-sidebar {
  background: rgba(17, 17, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--ml-glass-border);
}
.glass-surface {
  background: var(--ml-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ml-glass-border);
}
/* ── Animated Gradient Border ───────────────────────────────────── */
.gradient-border {
  position: relative;
  border: none !important;
}
.gradient-border::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 160, 0, 0.3),
    rgba(255, 109, 0, 0.1),
    rgba(255, 160, 0, 0.3)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ml-transition-smooth);
}
.gradient-border:hover::after {
  opacity: 1;
}
/* ── Media Type Badges ──────────────────────────────────────────── */
.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.media-badge--video {
  background: rgba(34, 211, 238, 0.15);
  color: var(--ml-type-video);
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.media-badge--audio {
  background: rgba(168, 85, 247, 0.15);
  color: var(--ml-type-audio);
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.media-badge--image {
  background: rgba(245, 158, 11, 0.15);
  color: var(--ml-type-image);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.media-badge--document {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ml-type-document);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.media-badge--archive {
  background: rgba(244, 114, 182, 0.15);
  color: var(--ml-type-archive);
  border: 1px solid rgba(244, 114, 182, 0.2);
}
/* ── Keyframe Animations ────────────────────────────────────────── */
@keyframes ml-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes ml-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes ml-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ml-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ml-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes ml-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 160, 0, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 160, 0, 0.3);
  }
}
@keyframes ml-gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes ml-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes ml-border-rotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}
/* ── Animation Utility Classes ──────────────────────────────────── */
.animate-fade-in {
  animation: ml-fade-in 0.4s ease-out forwards;
}
.animate-slide-up {
  animation: ml-slide-up 0.5s ease-out forwards;
}
.animate-scale-in {
  animation: ml-scale-in 0.3s ease-out forwards;
}
.animate-shimmer {
  position: relative;
  overflow: hidden;
}
.animate-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ml-gradient-shimmer);
  animation: ml-shimmer 2s infinite;
}
.animate-float {
  animation: ml-float 3s ease-in-out infinite;
}
/* ── Skeleton Loading ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--ml-bg-card) 25%,
    var(--ml-bg-card-hover) 50%,
    var(--ml-bg-card) 75%
  );
  background-size: 200% 100%;
  animation: ml-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--ml-radius-sm);
}
/* ── Stat Card Styles ───────────────────────────────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--ml-radius-md);
  background: var(--ml-gradient-card);
  border: 1px solid var(--ml-glass-border);
  transition: all var(--ml-transition-smooth);
}
.stat-card:hover {
  border-color: rgba(255, 160, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--ml-shadow-md);
}
.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.stat-card__icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  opacity: 0.3;
  filter: blur(8px);
}
.stat-card__value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: var(--ml-gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ml-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* ── Gallery Card ───────────────────────────────────────────────── */
.gallery-card {
  position: relative;
  border-radius: var(--ml-radius-md);
  overflow: hidden;
  background: var(--ml-bg-card);
  border: 1px solid var(--ml-glass-border);
  cursor: pointer;
  transition: all var(--ml-transition-smooth);
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--ml-shadow-lg);
}
.gallery-card:hover .gallery-card__overlay {
  opacity: 1;
}
.gallery-card:hover .gallery-card__actions {
  opacity: 1;
  transform: translateY(0);
}
.gallery-card__thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--ml-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ml-transition-smooth);
}
.gallery-card:hover .gallery-card__thumbnail img {
  transform: scale(1.05);
}
.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.7) 100%
  );
  opacity: 0;
  transition: opacity var(--ml-transition-smooth);
  pointer-events: none;
}
.gallery-card__actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--ml-transition-smooth);
}
.gallery-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.gallery-card__info {
  padding: 12px;
}
.gallery-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ml-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.gallery-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  color: var(--ml-text-secondary);
}
/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 16px;
}
.empty-state__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 160, 0, 0.1), rgba(255, 109, 0, 0.05));
  border: 1px solid rgba(255, 160, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ml-float 3s ease-in-out infinite;
}
.empty-state__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ml-text-primary);
}
.empty-state__subtitle {
  font-size: 0.875rem;
  color: var(--ml-text-secondary);
  max-width: 360px;
  line-height: 1.5;
}
/* ── Tab Indicator ──────────────────────────────────────────────── */
.MuiTabs-indicator {
  height: 3px !important;
  border-radius: 3px 3px 0 0 !important;
  background: var(--ml-gradient-accent) !important;
}
/* ── Search Field Glass Effect ──────────────────────────────────── */
.search-glass .MuiOutlinedInput-root {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--ml-radius-sm);
  transition: all var(--ml-transition-smooth);
}
.search-glass .MuiOutlinedInput-root:hover {
  background: rgba(255, 255, 255, 0.05);
}
.search-glass .MuiOutlinedInput-root.Mui-focused {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(255, 160, 0, 0.2);
}
/* ── Folder Item Hover Glow ─────────────────────────────────────── */
.folder-item {
  position: relative;
  transition: all var(--ml-transition-fast);
}
.folder-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background var(--ml-transition-smooth);
}
.folder-item:hover::before {
  background: var(--ml-accent);
}
.folder-item--selected::before {
  background: var(--ml-accent) !important;
}
/* ── Provider Dot ───────────────────────────────────────────────── */
.provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.provider-dot--google { background: var(--ml-cloud-google); }
.provider-dot--box { background: var(--ml-cloud-box); }
.provider-dot--dropbox { background: var(--ml-cloud-dropbox); }
.provider-dot--firebase { background: var(--ml-cloud-firebase); }
.provider-dot--local { background: var(--ml-cloud-local); }
/* ── Action Button ──────────────────────────────────────────────── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--ml-transition-fast);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}
.action-btn--primary {
  background: rgba(255, 160, 0, 0.25);
  color: var(--ml-accent-light);
}
.action-btn--primary:hover {
  background: rgba(255, 160, 0, 0.4);
}
/* ── Cinema Mode (Neutral Grey for distraction-free review) ───── */
[data-cinema="true"],
:root[data-cinema="true"],
body[data-cinema="true"] {
  --ml-accent: #A1A1AA;
  --ml-accent-light: #D4D4D8;
  --ml-accent-dark: #71717A;
  --ml-accent-glow: rgba(161, 161, 170, 0.15);
  --ml-bg-deep: #09090B;
  --ml-bg-surface: #121215;
  --ml-bg-elevated: #18181D;
  --ml-bg-card: #141419;
  --ml-bg-card-hover: #1E1E26;
}
/* ── Layout Dimensions ──────────────────────────────────────────── */
:root {
  --ml-sidebar-width: 280px;
  --ml-inspector-width: 340px;
  --ml-header-height: 56px;
  --ml-timeline-height: 140px;
}
/* ── 3-Panel Cinema Layout ──────────────────────────────────────── */
.cinema-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--ml-bg-deep);
  color: var(--ml-text-primary);
}
.cinema-sidebar {
  width: var(--ml-sidebar-width);
  min-width: 220px;
  max-width: 380px;
  height: 100%;
  border-right: 1px solid var(--ml-glass-border);
  background: var(--ml-bg-surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--ml-transition-smooth), transform var(--ml-transition-smooth);
}
.cinema-sidebar--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  border-right: none;
}
.cinema-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.cinema-inspector {
  width: var(--ml-inspector-width);
  min-width: 280px;
  max-width: 480px;
  height: 100%;
  border-left: 1px solid var(--ml-glass-border);
  background: var(--ml-bg-surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--ml-transition-smooth), transform var(--ml-transition-smooth);
}
.cinema-inspector--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  border-left: none;
}
/* ── Command Palette (⌘K) ───────────────────────────────────────── */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.command-palette-modal {
  width: 100%;
  max-width: 640px;
  background: var(--ml-bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--ml-radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 160, 0, 0.2);
  overflow: hidden;
  animation: ml-scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.command-palette-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.125rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ml-text-primary);
  border-bottom: 1px solid var(--ml-glass-border);
}
.command-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--ml-radius-sm);
  cursor: pointer;
  transition: all var(--ml-transition-fast);
}
.command-palette-item:hover,
.command-palette-item--selected {
  background: rgba(255, 160, 0, 0.12);
  color: var(--ml-accent-light);
}
/* ── Dropzone Overlay ───────────────────────────────────────────── */
.dropzone-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 3px dashed var(--ml-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  animation: ml-fade-in 0.2s ease-out;
}
/* ── Annotation Canvas Overlay ──────────────────────────────────── */
.annotation-overlay-container {
  position: absolute;
  inset: 0;
  pointer-events: all;
  z-index: 10;
  touch-action: none;
}
.annotation-pin-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  transition: transform 0.15s ease;
}
.annotation-pin-marker:hover {
  transform: translate(-50%, -115%) scale(1.2);
}
/* ── Video Player Waveform & Timeline ───────────────────────────── */
.scrubber-track {
  position: relative;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
}
.scrubber-waveform {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
}
.scrubber-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 1px;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.1s;
}
.scrubber-marker:hover {
  transform: scaleY(1.3);
}
/* ── Transcript Word Highlight ──────────────────────────────────── */
.transcript-word {
  display: inline-block;
  padding: 2px 4px;
  margin: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.transcript-word:hover {
  background: rgba(255, 160, 0, 0.2);
  color: var(--ml-accent-light);
}
.transcript-word--active {
  background: var(--ml-accent) !important;
  color: #000 !important;
  font-weight: 700;
  box-shadow: 0 0 10px var(--ml-accent-glow);
}
/* ── Dynamic Session Watermark (Studio Anti-Leak) ────────────────── */
.dynamic-session-watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Inter', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 25;
  letter-spacing: 0.05em;
  transition: top 3s ease-in-out, left 3s ease-in-out;
}

/* Copyright 2014 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
  --react-pdf-annotation-layer: 1;
  --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
  --input-focus-border-color: Highlight;
  --input-focus-outline: 1px solid Canvas;
  --input-unfocused-border-color: transparent;
  --input-disabled-border-color: transparent;
  --input-hover-border-color: black;
  --link-outline: none;
}

@media screen and (forced-colors: active) {
  :root {
    --input-focus-border-color: CanvasText;
    --input-unfocused-border-color: ActiveText;
    --input-disabled-border-color: GrayText;
    --input-hover-border-color: Highlight;
    --link-outline: 1.5px solid LinkText;
  }
  .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
  .annotationLayer .choiceWidgetAnnotation select:required,
  .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {
    outline: 1.5px solid selectedItem;
  }

  .annotationLayer .linkAnnotation:hover {
    backdrop-filter: invert(100%);
  }
}

.annotationLayer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  transform-origin: 0 0;
  z-index: 3;
}

.annotationLayer[data-main-rotation='90'] .norotate {
  transform: rotate(270deg) translateX(-100%);
}
.annotationLayer[data-main-rotation='180'] .norotate {
  transform: rotate(180deg) translate(-100%, -100%);
}
.annotationLayer[data-main-rotation='270'] .norotate {
  transform: rotate(90deg) translateY(-100%);
}

.annotationLayer canvas {
  position: absolute;
  width: 100%;
  height: 100%;
}

.annotationLayer section {
  position: absolute;
  text-align: initial;
  pointer-events: auto;
  box-sizing: border-box;
  margin: 0;
  transform-origin: 0 0;
}

.annotationLayer .linkAnnotation {
  outline: var(--link-outline);
}

.textLayer.selecting ~ .annotationLayer section {
  pointer-events: none;
}

.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
  position: absolute;
  font-size: 1em;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a:hover {
  opacity: 0.2;
  background: rgba(255, 255, 0, 1);
  box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
}

.annotationLayer .textAnnotation img {
  position: absolute;
  cursor: pointer;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.annotationLayer .textWidgetAnnotation :is(input, textarea),
.annotationLayer .choiceWidgetAnnotation select,
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
  background-image: var(--annotation-unfocused-field-background);
  border: 2px solid var(--input-unfocused-border-color);
  box-sizing: border-box;
  font: calc(9px * var(--scale-factor)) sans-serif;
  height: 100%;
  margin: 0;
  vertical-align: top;
  width: 100%;
}

.annotationLayer .textWidgetAnnotation :is(input, textarea):required,
.annotationLayer .choiceWidgetAnnotation select:required,
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {
  outline: 1.5px solid red;
}

.annotationLayer .choiceWidgetAnnotation select option {
  padding: 0;
}

.annotationLayer .buttonWidgetAnnotation.radioButton input {
  border-radius: 50%;
}

.annotationLayer .textWidgetAnnotation textarea {
  resize: none;
}

.annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
.annotationLayer .choiceWidgetAnnotation select[disabled],
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] {
  background: none;
  border: 2px solid var(--input-disabled-border-color);
  cursor: not-allowed;
}

.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover {
  border: 2px solid var(--input-hover-border-color);
}
.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover {
  border-radius: 2px;
}

.annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
.annotationLayer .choiceWidgetAnnotation select:focus {
  background: none;
  border: 2px solid var(--input-focus-border-color);
  border-radius: 2px;
  outline: var(--input-focus-outline);
}

.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
  background-image: none;
  background-color: transparent;
}

.annotationLayer .buttonWidgetAnnotation.checkBox :focus {
  border: 2px solid var(--input-focus-border-color);
  border-radius: 2px;
  outline: var(--input-focus-outline);
}

.annotationLayer .buttonWidgetAnnotation.radioButton :focus {
  border: 2px solid var(--input-focus-border-color);
  outline: var(--input-focus-outline);
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
  background-color: CanvasText;
  content: '';
  display: block;
  position: absolute;
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
  height: 80%;
  left: 45%;
  width: 1px;
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before {
  transform: rotate(45deg);
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
  transform: rotate(-45deg);
}

.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
  border-radius: 50%;
  height: 50%;
  left: 30%;
  top: 20%;
  width: 50%;
}

.annotationLayer .textWidgetAnnotation input.comb {
  font-family: monospace;
  padding-left: 2px;
  padding-right: 0;
}

.annotationLayer .textWidgetAnnotation input.comb:focus {
  /*
   * Letter spacing is placed on the right side of each character. Hence, the
   * letter spacing of the last character may be placed outside the visible
   * area, causing horizontal scrolling. We avoid this by extending the width
   * when the element has focus and revert this when it loses focus.
   */
  width: 103%;
}

.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
  appearance: none;
}

.annotationLayer .popupTriggerArea {
  height: 100%;
  width: 100%;
}

.annotationLayer .fileAttachmentAnnotation .popupTriggerArea {
  position: absolute;
}

.annotationLayer .popupWrapper {
  position: absolute;
  font-size: calc(9px * var(--scale-factor));
  width: 100%;
  min-width: calc(180px * var(--scale-factor));
  pointer-events: none;
}

.annotationLayer .popup {
  position: absolute;
  max-width: calc(180px * var(--scale-factor));
  background-color: rgba(255, 255, 153, 1);
  box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor))
    rgba(136, 136, 136, 1);
  border-radius: calc(2px * var(--scale-factor));
  padding: calc(6px * var(--scale-factor));
  margin-left: calc(5px * var(--scale-factor));
  cursor: pointer;
  font: message-box;
  white-space: normal;
  word-wrap: break-word;
  pointer-events: auto;
}

.annotationLayer .popup > * {
  font-size: calc(9px * var(--scale-factor));
}

.annotationLayer .popup h1 {
  display: inline-block;
}

.annotationLayer .popupDate {
  display: inline-block;
  margin-left: calc(5px * var(--scale-factor));
}

.annotationLayer .popupContent {
  border-top: 1px solid rgba(51, 51, 51, 1);
  margin-top: calc(2px * var(--scale-factor));
  padding-top: calc(2px * var(--scale-factor));
}

.annotationLayer .richText > * {
  white-space: pre-wrap;
  font-size: calc(9px * var(--scale-factor));
}

.annotationLayer .highlightAnnotation,
.annotationLayer .underlineAnnotation,
.annotationLayer .squigglyAnnotation,
.annotationLayer .strikeoutAnnotation,
.annotationLayer .freeTextAnnotation,
.annotationLayer .lineAnnotation svg line,
.annotationLayer .squareAnnotation svg rect,
.annotationLayer .circleAnnotation svg ellipse,
.annotationLayer .polylineAnnotation svg polyline,
.annotationLayer .polygonAnnotation svg polygon,
.annotationLayer .caretAnnotation,
.annotationLayer .inkAnnotation svg polyline,
.annotationLayer .stampAnnotation,
.annotationLayer .fileAttachmentAnnotation {
  cursor: pointer;
}

.annotationLayer section svg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.annotationLayer .annotationTextContent {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  color: transparent;
  user-select: none;
  pointer-events: none;
}

.annotationLayer .annotationTextContent span {
  width: 100%;
  display: inline-block;
}
/* Copyright 2014 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
  --react-pdf-text-layer: 1;
  --highlight-bg-color: rgba(180, 0, 170, 1);
  --highlight-selected-bg-color: rgba(0, 100, 0, 1);
}

@media screen and (forced-colors: active) {
  :root {
    --highlight-bg-color: Highlight;
    --highlight-selected-bg-color: ButtonText;
  }
}

[data-main-rotation='90'] {
  transform: rotate(90deg) translateY(-100%);
}
[data-main-rotation='180'] {
  transform: rotate(180deg) translate(-100%, -100%);
}
[data-main-rotation='270'] {
  transform: rotate(270deg) translateX(-100%);
}

.textLayer {
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: hidden;
  line-height: 1;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  z-index: 2;
}

.textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  margin: 0;
  transform-origin: 0 0;
}

/* Only necessary in Google Chrome, see issue 14205, and most unfortunately
 * the problem doesn't show up in "text" reference tests. */
.textLayer span.markedContent {
  top: 0;
  height: 0;
}

.textLayer .highlight {
  margin: -1px;
  padding: 1px;
  background-color: var(--highlight-bg-color);
  border-radius: 4px;
}

.textLayer .highlight.appended {
  position: initial;
}

.textLayer .highlight.begin {
  border-radius: 4px 0 0 4px;
}

.textLayer .highlight.end {
  border-radius: 0 4px 4px 0;
}

.textLayer .highlight.middle {
  border-radius: 0;
}

.textLayer .highlight.selected {
  background-color: var(--highlight-selected-bg-color);
}

/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
.textLayer br::selection {
  background: transparent;
}

.textLayer .endOfContent {
  display: block;
  position: absolute;
  inset: 100% 0 0;
  z-index: -1;
  cursor: default;
  user-select: none;
}

.textLayer.selecting .endOfContent {
  top: 0;
}

.hiddenCanvasElement {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  display: none;
}
