:root {
  --bg-main: #0a0c10;
  --card-bg: #12151f;
  --card-alt: #181c28;
  --card-hover: #222738;
  --accent-blue: #388bfd;
  --accent-blue-hover: #58a6ff;
  --accent-green: #2ea043;
  --accent-red: #ff453a;
  --text-white: #f0f6fc;
  --text-muted: #8b949e;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(88, 166, 255, 0.45);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-white);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

.app-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: none;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

.app-container.ready {
  display: flex;
}

.controls-header {
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 10px 12px 12px;
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

.selector-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.dropdown-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-wrapper label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.month-box {
  flex: 0 0 120px;
}

.lesson-box {
  flex: 1 1 auto;
  min-width: 0;
}

.dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  cursor: pointer;
  height: 40px;
  gap: 6px;
  transition: all 0.15s ease;
}

.dropdown-btn:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
}

.dropdown-btn span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #f0f6fc;
  font-weight: 500;
}

.dropdown-btn .arrow {
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: #1f2026;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 200;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  padding: 10px 12px;
  font-size: 13px;
  color: #ddd;
  border-bottom: 1px solid #282932;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover, .dropdown-item.selected {
  background: var(--card-hover);
  color: #fff;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon-svg {
  position: absolute;
  left: 12px;
  pointer-events: none;
  opacity: 0.8;
  flex-shrink: 0;
}

#liveSearchInput {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background: var(--card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

#liveSearchInput:focus {
  border-color: var(--border-focus);
  background: #1b2030;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 14px;
  right: 14px;
  background: #1f2026;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 150;
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid #2a2b33;
  cursor: pointer;
}

.search-item-title {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.search-item-sub {
  font-size: 11px;
  color: var(--accent-blue);
}

.player-section {
  width: calc(100% - 32px) !important;
  margin: 0 16px 14px !important;
  background: var(--card-bg, #12151f) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
  position: relative !important;
  user-select: none !important;
}

.video-container {
  width: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.video-container video {
  width: 100%;
  display: block;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
}

.video-gesture-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 54px;
  z-index: 15;
  background: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.video-rotate-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(18, 20, 26, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  opacity: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

.video-rotate-btn:hover {
  background: rgba(32, 36, 48, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.video-rotate-btn:active {
  transform: scale(0.92);
}

.video-rotate-btn::before {
  content: "";
  position: absolute;
  right: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  border: 5px solid transparent;
  border-left-color: rgba(18, 20, 26, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 2147483648;
}

.video-rotate-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  background: rgba(18, 20, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 2147483648;
}

.video-rotate-btn:hover::before,
.video-rotate-btn:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.video-rotate-btn .rotate-icon {
  width: 20px;
  height: 20px;
  color: #ffffff;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-rotate-btn:active .rotate-icon {
  transform: rotate(90deg);
}

.video-rotate-btn.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.video-seek-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.2s ease;
  overflow: hidden;
  user-select: none;
}

.video-seek-overlay.seek-left {
  left: 0;
  border-radius: 0 100% 100% 0;
}

.video-seek-overlay.seek-right {
  right: 0;
  border-radius: 100% 0 0 100%;
}

.video-seek-overlay .seek-ripple {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.6);
  border-radius: inherit;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.video-seek-overlay.seek-left .seek-ripple {
  background: radial-gradient(ellipse at 0% 50%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 60%, transparent 80%);
}

.video-seek-overlay.seek-right .seek-ripple {
  background: radial-gradient(ellipse at 100% 50%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 60%, transparent 80%);
}

.video-seek-overlay.active {
  opacity: 1;
}

.video-seek-overlay.active .seek-ripple {
  opacity: 1;
  transform: scale(1);
}

.video-seek-overlay .seek-badge {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  transform: scale(0.85);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-seek-overlay.active .seek-badge {
  transform: scale(1.08);
}

.video-seek-overlay .seek-seconds {
  font-variant-numeric: tabular-nums;
}

.video-seek-overlay .seek-chevron {
  font-size: 24px;
  line-height: 1;
  opacity: 0.9;
}

.video-tap-feedback.feedback-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 35;
  user-select: none;
}

.video-tap-feedback.feedback-center svg {
  color: #ffffff;
  animation: none;
}

.video-tap-feedback.feedback-center.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

.video-tap-feedback.feedback-center.show svg {
  transform: rotate(180deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exit-landscape-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000;
}

.video-container.in-landscape-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vh !important;
  height: 100vw !important;
  transform: rotate(90deg) translateY(-100vw) !important;
  transform-origin: top left !important;
  z-index: 99999 !important;
  background: #000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.video-container.in-landscape-mode video {
  width: 100% !important;
  height: 100% !important;
  max-height: 100vh !important;
  object-fit: contain !important;
}

.player-section {
  width: calc(100% - 32px) !important;
  margin: 0 16px 14px !important;
  background: var(--card-bg, #12151f) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
}

video {
  width: 100%;
  max-height: 48vh;
  aspect-ratio: 16 / 9;
  display: block;
}

.media-parts-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 14px !important;
  background: #0d0f15 !important;
  border-top: 1px solid var(--border-color) !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
}

.lesson-nav-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-alt);
  border: 1px solid var(--border-color);
  color: #c9d1d9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lesson-nav-btn:hover:not(:disabled) {
  background: var(--card-hover);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 2px 10px rgba(56, 139, 253, 0.25);
  transform: scale(1.06);
}

.lesson-nav-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.lesson-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.04);
}

.video-chips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1 1 auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.video-chips-row::-webkit-scrollbar { display: none; }

.video-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--card-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  transition: all 0.18s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-chip:hover {
  background: var(--card-hover);
  color: #fff;
  border-color: var(--border-hover);
}
.video-chip.active {
  background: rgba(56, 139, 253, 0.18);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 2px 8px rgba(56, 139, 253, 0.2);
}

.sub-parts-bar {
  background: var(--card-alt);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border-color);
}

.pill-btn {
  background: var(--card-hover);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.12);
}
.pill-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.badge {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.lesson-meta {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 6px 36px 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

.lesson-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 12px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  margin-bottom: 6px !important;
  max-width: 80% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lesson-meta h1 {
  font-size: 13.5px !important;
  line-height: 1.35 !important;
  font-weight: 650 !important;
  color: #f0f6fc !important;
  text-align: center !important;
  max-width: 80% !important;
  margin: 0 auto !important;
  padding: 0 4px !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.lesson-meta h1.expanded {
  -webkit-line-clamp: unset !important;
  display: block !important;
  overflow: visible !important;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 0 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-item:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.04);
}

.tab-item.active {
  background: rgba(56, 139, 253, 0.14);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.35);
}

.tab-icon-svg {
  flex-shrink: 0;
}

.tab-content-area {
  padding: 0 12px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.files-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.file-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.18s ease;
}

.file-item-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.file-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  user-select: none;
}

.file-icon-badge.type-pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #f85149;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.file-icon-badge.type-pptx {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.32);
}

.file-icon-badge.type-docx {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.32);
}

.file-icon-badge.type-markdown {
  background: rgba(13, 148, 136, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(13, 148, 136, 0.32);
}

.file-icon-badge.type-sheet {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.file-icon-badge.type-audio {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.32);
}

.file-icon-badge.type-video {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.32);
}

.file-icon-badge.type-zip {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.32);
}

.file-icon-badge.type-text {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.32);
}

.file-icon-badge.type-code {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.32);
}

.file-icon-badge.type-image {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.32);
}

.file-icon-badge.type-generic {
  background: rgba(255, 255, 255, 0.08);
  color: #8b949e;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.file-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f0f6fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-ext {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.file-action-btn.btn-open-primary {
  background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.35);
}

.file-action-btn.btn-open-primary:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.file-action-btn.btn-chat-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  cursor: pointer;
}

.file-action-btn.btn-chat-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.file-action-btn.btn-chat-icon:active {
  transform: scale(0.95);
}

.file-action-btn.btn-chat-icon .spin-icon {
  animation: spinAction 0.8s linear infinite;
}

@keyframes spinAction {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  .file-item-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .file-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .file-action-btn.btn-open-primary {
    flex: 1;
    justify-content: center;
  }
  .file-action-btn.btn-chat-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
}

.file-name-label {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 6px;
}

.content-box {
  background: var(--card-bg);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  font-size: 14px;
  line-height: 1.6;
  color: #d8d8de;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  flex: 1;
}

.action-buttons-row {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.file-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0e0f14;
  display: flex;
  flex-direction: column;
}

.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: #14151c;
  gap: 10px;
}

.file-viewer-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pdf-controls {
  display: flex;
  align-items: center;
  background: #1f2029;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px 6px;
  gap: 6px;
}

.viewer-icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.viewer-icon-btn:hover {
  background: var(--card-hover);
}

.pdf-page-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

.file-viewer-close {
  background: #2c2f3a;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-viewer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #121318;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(14, 15, 20, 0.85);
  z-index: 50;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pdf-viewer-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  box-sizing: border-box;
}

.pdf-page-canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.doc-viewer-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
  background: #ffffff;
  color: #1a1a1a;
  min-height: 100%;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Georgia, serif;
  line-height: 1.6;
  font-size: 15px;
  overflow-y: auto;
  user-select: text;
}

.doc-viewer-container h1, .doc-viewer-container h2, .doc-viewer-container h3 {
  color: #111;
  margin: 16px 0 8px;
}

.doc-viewer-container p {
  margin-bottom: 12px;
}

.doc-viewer-container table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
}

.doc-viewer-container th, .doc-viewer-container td {
  border: 1px solid #ccc;
  padding: 8px 10px;
}

.doc-viewer-container img {
  max-width: 100%;
  height: auto;
}

.markdown-viewer-container {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  box-sizing: border-box;
  color: #e6edf3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  font-size: 15px;
  user-select: text;
  -webkit-user-select: text;
}

.markdown-viewer-container h1,
.markdown-viewer-container h2,
.markdown-viewer-container h3,
.markdown-viewer-container h4 {
  color: #f0f6fc;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.markdown-viewer-container h1 { font-size: 22px; }
.markdown-viewer-container h2 { font-size: 18px; margin-top: 20px; }
.markdown-viewer-container h3 { font-size: 16px; border-bottom: none; }

.markdown-viewer-container p {
  margin-bottom: 14px;
  color: #c9d1d9;
}

.markdown-viewer-container hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 24px 0;
}

.markdown-viewer-container ul,
.markdown-viewer-container ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: #c9d1d9;
}

.markdown-viewer-container li {
  margin-bottom: 6px;
}

.markdown-viewer-container strong {
  color: #ffffff;
  font-weight: 700;
}

.markdown-viewer-container em {
  color: #d2a8ff;
  font-style: italic;
}

.markdown-viewer-container blockquote {
  border-left: 3px solid #58a6ff;
  padding: 8px 16px;
  margin: 14px 0;
  background: rgba(56, 139, 253, 0.08);
  border-radius: 0 8px 8px 0;
  color: #8b949e;
}

.markdown-viewer-container code.inline-code {
  background: rgba(110, 118, 129, 0.35);
  color: #79c0ff;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
}

.markdown-viewer-container pre {
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}

.markdown-viewer-container pre code {
  color: #e6edf3;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre;
}

.markdown-viewer-container table {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-viewer-container th,
.markdown-viewer-container td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  font-size: 13.5px;
}

.markdown-viewer-container th {
  background: #161b22;
  color: #58a6ff;
  font-weight: 600;
  text-align: left;
}

.markdown-viewer-container tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.image-viewer-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.viewer-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.code-viewer-container {
  flex: 1;
  padding: 16px;
  overflow: auto;
}

.code-viewer-container pre {
  margin: 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e6e6e6;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}

.file-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.pptx-controls {
  display: flex;
  align-items: center;
  background: #1f2029;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px 6px;
  gap: 6px;
}

.pptx-slide-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 54px;
  text-align: center;
}

.copy-code-btn {
  background: #1f2029 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  color: #fff;
  padding: 4px 8px;
}

.pptx-viewer-container {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 0 36px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.pptx-slide-canvas {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 9;
  background: #ffffff;
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  container-type: inline-size;
  user-select: text;
  box-sizing: border-box;
  margin: 0;
}

.pptx-slide-floating-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(18, 20, 29, 0.82);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.35);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pptx-connectors-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.pptx-canvas-elem {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pptx-picture {
  z-index: 2;
  pointer-events: none;
}

.pptx-shape {
  z-index: 3;
  padding: 2px 4px;
  border-radius: 4px;
}

.pptx-shape.diamond {
  background: transparent !important;
  border: none !important;
}

.pptx-diamond-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.pptx-text-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow: visible;
  line-height: 1.25;
}

.pptx-text-p {
  font-size: clamp(8px, 1.6cqw, 16px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  word-break: break-word;
  margin: 1px 0;
}

.pptx-table-box {
  z-index: 3;
  overflow: auto;
}

.pptx-slide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(7px, 1.3cqw, 13px);
  background: #ffffff;
  color: #111827;
}

.pptx-slide-table th {
  background: #f3f4f6;
  color: #111827;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  font-weight: 600;
}

.pptx-slide-table td {
  padding: 4px 6px;
  border: 1px solid #e5e7eb;
  color: #1f2937;
}

.sheet-viewer-container {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  background: #161822;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sheet-table th {
  background: #212433;
  color: #58a6ff;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
}

.sheet-table td {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #c9d1d9;
  user-select: text;
}

.sheet-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.audio-viewer-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.audio-player-card {
  width: 100%;
  max-width: 440px;
  background: #181a24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.audio-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(43, 138, 245, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.audio-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  word-break: break-all;
}

.viewer-audio-element {
  width: 100%;
  margin-top: 8px;
}

.card-viewer-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.file-card-box {
  width: 100%;
  max-width: 460px;
  background: #181a24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.file-card-icon {
  font-size: 54px;
}

.file-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  word-break: break-all;
  margin: 0;
}

.file-card-notice {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.5;
  margin: 0;
}

.file-card-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  margin-top: 10px;
}

.file-card-actions .action-btn {
  width: 100%;
}

.tab-item.tab-hidden,
.content-box.hidden {
  display: none !important;
}

.access-denied-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: #030305;
  overflow: hidden;
  user-select: none;
}

.access-denied-backdrop {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 35%, rgba(3, 3, 5, 0.98) 72%),
    linear-gradient(180deg, #09090d 0%, #020204 100%);
  pointer-events: none;
}

.access-denied-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(25px);
  pointer-events: none;
  animation: accessGlowPulse 4s ease-in-out infinite alternate;
}

.access-denied-card {
  position: relative;
  z-index: 2;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 
    0 0 50px rgba(255, 255, 255, 0.05),
    0 25px 50px rgba(0, 0, 0, 0.85),
    inset 0 0 25px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: accessCardFloat 4s ease-in-out infinite alternate;
}

.access-denied-x {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
}

@keyframes accessCardFloat {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.05), 0 25px 50px rgba(0, 0, 0, 0.85);
  }
  100% {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 70px rgba(255, 255, 255, 0.09), 0 30px 60px rgba(0, 0, 0, 0.95);
  }
}

@keyframes accessGlowPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.15);
    opacity: 0.9;
  }
}

/* ========================================================
   MODERN ORBITAL JAVA LOADING SCREEN
   ======================================================== */
.app-loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07090e;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.app-loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-bg-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 139, 253, 0.15) 0%, rgba(88, 166, 255, 0.03) 50%, transparent 70%);
  filter: blur(35px);
  pointer-events: none;
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.loading-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* Orbital System */
.orbital-system {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbital-ring {
  position: absolute;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}

.orbital-ring.ring-1 {
  width: 136px;
  height: 136px;
  border: 1.5px dashed rgba(88, 166, 255, 0.3);
  animation: orbitRotate 10s linear infinite;
}

.orbital-ring.ring-2 {
  width: 110px;
  height: 110px;
  border: 1.5px solid rgba(88, 166, 255, 0.18);
  border-top-color: #58a6ff;
  border-bottom-color: #ff7b72;
  animation: orbitRotateRev 6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.orbital-ring.ring-3 {
  width: 86px;
  height: 86px;
  border: 1px dotted rgba(255, 255, 255, 0.2);
  animation: orbitRotate 14s linear infinite;
}

.orbital-dot {
  position: absolute;
  border-radius: 50%;
}

.orbital-dot.dot-1 {
  width: 8px;
  height: 8px;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #58a6ff;
  box-shadow: 0 0 10px #58a6ff, 0 0 20px #58a6ff;
}

.orbital-dot.dot-2 {
  width: 7px;
  height: 7px;
  bottom: -3.5px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff7b72;
  box-shadow: 0 0 8px #ff7b72;
}

.core-icon-container {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(18, 21, 31, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(56, 139, 253, 0.12);
}

.java-coffee-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.steam {
  animation: steamRise 2s ease-in-out infinite;
}
.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: 0.4s; }
.steam-3 { animation-delay: 0.8s; }

@keyframes steamRise {
  0% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 1; }
  100% { transform: translateY(-6px); opacity: 0.2; }
}

@keyframes orbitRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbitRotateRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.15); opacity: 0.8; }
}

/* Progress Wrap */
.loading-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 180px;
}

.loading-percentage {
  font-size: 22px;
  font-weight: 700;
  color: #f0f6fc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(88, 166, 255, 0.4);
}

.loading-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 1%;
  background: linear-gradient(90deg, #388bfd, #58a6ff, #56d364);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.6);
  transition: width 0.15s ease-out;
}

.loading-status-text {
  font-size: 13px;
  color: #8b949e;
  font-weight: 500;
  letter-spacing: 0.3px;
  animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* Responsive Media Bar & Video Chips */
.media-parts-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  background: #0d0f15 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.lesson-nav-btn {
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #181c28 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f0f6fc !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  padding: 0 !important;
  z-index: 2 !important;
}
.lesson-nav-btn:hover:not(:disabled) {
  background: #222738 !important;
  color: #58a6ff !important;
  border-color: rgba(88, 166, 255, 0.5) !important;
  box-shadow: 0 2px 12px rgba(56, 139, 253, 0.35) !important;
  transform: scale(1.08) !important;
}
.lesson-nav-btn:active:not(:disabled) {
  transform: scale(0.92) !important;
}
.lesson-nav-btn:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}
.media-parts-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 14px !important;
  background: #0d0f15 !important;
  border-top: 1px solid var(--border-color) !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
}
.video-chips-row {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  max-width: calc(100% - 92px) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding: 2px 2px !important;
}
.video-chips-row::-webkit-scrollbar { display: none !important; }
.video-chip {
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  background: #181c28 !important;
  color: #8b949e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}
.video-chip:hover {
  background: #222738 !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
.video-chip.active {
  background: rgba(56, 139, 253, 0.18) !important;
  color: #58a6ff !important;
  border-color: rgba(88, 166, 255, 0.45) !important;
  box-shadow: 0 2px 10px rgba(56, 139, 253, 0.25) !important;
}
.video-chips-row.compact .video-chip {
  padding: 5px 10px !important;
  font-size: 12px !important;
  gap: 4px !important;
}

/* Beautiful centered lesson meta so titles and badges never hug the edges */
.lesson-meta {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 6px 36px 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}
.lesson-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 12px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  margin-bottom: 6px !important;
  max-width: 80% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.lesson-meta h1 {
  font-size: 13.5px !important;
  line-height: 1.35 !important;
  font-weight: 650 !important;
  color: #f0f6fc !important;
  text-align: center !important;
  max-width: 80% !important;
  margin: 0 auto !important;
  padding: 0 4px !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.lesson-meta h1.expanded {
  -webkit-line-clamp: unset !important;
  display: block !important;
  overflow: visible !important;
}

/* Tabs nav with safe margins and nowrap text */
.tabs-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 5px !important;
  background: var(--card-bg, #12151f) !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
  border-radius: 14px !important;
  margin: 0 16px 14px !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.tabs-nav::-webkit-scrollbar { display: none !important; }
.tab-item {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 9px 8px !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}
.tab-item span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.tab-content-area {
  padding: 0 16px 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
.controls-header {
  margin: 10px 16px 12px !important;
  box-sizing: border-box !important;
}


