/* Premium Enterprise SaaS Style for Industrial Briefing Dashboard */

:root {
  --bg-color: #f8fafc; /* Ice-Slate / Cool light-grey */
  --panel-bg: #ffffff; /* Solid White */
  --panel-border: #e2e8f0; /* Slate 200 border */
  
  --primary-color: #2563eb; /* Deep Royal Blue */
  --primary-glow: rgba(37, 99, 235, 0.06);
  --accent-color: #3b82f6; /* Accent Blue */
  --accent-glow: rgba(59, 130, 246, 0.06);
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --text-dark: #334155; /* Slate 700 */
  
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.2s ease-in-out;
}

/* Dark Mode / Night Mode Variables */
html.dark-mode body {
  --bg-color: #0b0f19; /* Deep Space Dark */
  --panel-bg: #111827; /* Slate Dark */
  --panel-border: #1f2937; /* Dark Border */
  
  --text-main: #f3f4f6; /* Off-White main */
  --text-muted: #9ca3af; /* Cool grey muted */
  --text-dark: #e5e7eb; /* Light grey text */
}

/* Dark Mode Component Overrides */
html.dark-mode .archive-item-condensed:hover {
  background: #1f2937;
  border-color: #374151;
}

html.dark-mode .archive-item-condensed.active {
  background: rgba(37, 99, 235, 0.18);
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html.dark-mode .archive-item-condensed.active .item-weekday {
  color: #60a5fa;
}

html.dark-mode .archive-item-condensed.active .item-date-label {
  color: #9ca3af;
}

html.dark-mode .archive-item-condensed.active .item-hook {
  color: #f3f4f6;
}

html.dark-mode .archive-folder-header:hover {
  background: #1f2937;
  border-bottom-color: #374151;
}

html.dark-mode .view-btn {
  background: #111827;
  border-color: #374151;
  color: #9ca3af;
}

html.dark-mode .view-btn:hover {
  background: #1f2937;
  color: #ffffff;
  border-color: #4b5563;
}

html.dark-mode .view-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

html.dark-mode .archive-controls .search-input,
html.dark-mode .archive-controls .filter-select {
  background: #111827;
  border-color: #374151;
  color: #f3f4f6;
}

html.dark-mode .archive-controls .search-input:focus,
html.dark-mode .archive-controls .filter-select:focus {
  background: #1f2937;
}

html.dark-mode .tab-btn {
  color: #9ca3af;
}

html.dark-mode .tab-btn:hover {
  color: #ffffff;
}

html.dark-mode .tab-btn.active {
  color: var(--primary-color);
}

html.dark-mode .modal-content {
  background: #111827;
  border-color: #1f2937;
  color: #f3f4f6;
}

html.dark-mode .linkedin-modal-content {
  background: #111827;
  border-color: #1f2937;
}

html.dark-mode .linkedin-post-section textarea {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

html.dark-mode .carousel-card {
  background: #1f2937;
  border-color: #374151;
}

html.dark-mode .carousel-arrow {
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .carousel-arrow:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Landing Page Specific Dark Mode Overrides */
html.dark-mode .sector-card-landing {
  background: #111827;
  border-color: #1f2937;
  color: #f3f4f6;
}

html.dark-mode .sector-card-landing:hover {
  background: #1f2937;
  border-color: rgba(37, 99, 235, 0.4);
}

html.dark-mode .sector-card-landing .sector-desc {
  color: #9ca3af;
}

html.dark-mode .nav-card {
  background: #111827;
  border-color: #1f2937;
  color: #f3f4f6;
}

html.dark-mode .nav-card:hover {
  background: #1f2937;
  border-color: rgba(37, 99, 235, 0.4);
}

html.dark-mode .nav-card .nav-meta {
  color: #9ca3af;
}

html.dark-mode .hero-title {
  color: #ffffff;
}

html.dark-mode .hero-subtitle {
  color: #9ca3af;
}

html.dark-mode .btn-secondary {
  background: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

html.dark-mode .btn-secondary:hover {
  background: #1f2937;
  color: #ffffff;
  border-color: #4b5563;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  font-family: var(--font-body);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a; /* Deep Slate Navy matching logo */
  color: #ffffff;
  border-bottom: 3px solid var(--primary-color);
  padding: 0.5rem 2rem;
  height: 90px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-area h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 40%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.65rem;
  color: #94a3b8; /* slate 400 */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: #10b981; /* Green status */
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
  height: 40px;
}

.profile-avatar {
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.profile-role {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* View Switcher pills below header */
.view-switcher-wrapper {
  padding: 1.25rem 2rem 0.5rem 2rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
}

.view-switcher-container {
  display: flex;
  gap: 0.75rem;
}

.view-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1; /* Slate 300 */
  color: #475569; /* Slate 600 */
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px; /* Pill */
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.view-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.view-btn.active {
  background: var(--primary-color); /* Royal Blue */
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 170px);
  min-height: 0;
  overflow: hidden;
  padding: 0 2rem 1.5rem 2rem;
  box-sizing: border-box;
}

/* Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

/* Sidebar */
.sidebar-panel {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.archive-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.archive-controls .search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.archive-controls .search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.archive-controls .filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.archive-controls .filter-select:focus {
  border-color: var(--primary-color);
  background: #ffffff;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.35rem;
}

/* Custom Scrollbar for list */
.archive-list::-webkit-scrollbar {
  width: 6px;
}
.archive-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 3px;
}
.archive-list::-webkit-scrollbar-thumb {
  background: #cbd5e1; /* Slate 300 */
  border-radius: 3px;
  transition: background 0.15s ease;
}
.archive-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8; /* Slate 400 */
}

.archive-folder-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.archive-folder-header:hover {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
}

.folder-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease-in-out;
  display: inline-block;
  width: 12px;
  text-align: center;
}

.archive-folder-header:hover .folder-icon {
  color: var(--primary-color);
}

.folder-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.folder-count {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
  background: var(--primary-glow);
  padding: 1px 6px;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

.archive-folder-content {
  display: flex;
  flex-direction: column;
  padding-left: 0.5rem;
  overflow: hidden;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.archive-folder-content.collapsed {
  display: none;
}

.archive-item-condensed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: transparent;
  border: 1px solid transparent;
}

.archive-item-condensed:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.archive-item-condensed.active {
  background: #eff6ff;
  border-color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.05);
}

.item-meta-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.item-weekday {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
}

.archive-item-condensed.active .item-weekday {
  color: var(--primary-color);
}

.item-date-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.item-hook {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.archive-item-condensed.active .item-hook {
  color: var(--text-main);
}

/* Main Content Area */
.content-panel {
  display: block;
  height: 100%;
  min-height: 0;
}

.content-panel.hidden {
  display: none;
}

/* Audio Player Card */
/* Audio Player Card */
.player-card {
  padding: 1.25rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.player-meta-container {
  display: flex;
  flex-direction: column;
}

.tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
  background: #eff6ff;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.4rem;
  border: 1px solid #bfdbfe;
}

.player-meta-container h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.player-meta-container p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-play-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0.5rem 0;
}

.player-ctrl-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.player-ctrl-btn:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.player-ctrl-btn:active {
  transform: scale(0.95);
}

.player-ctrl-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition-smooth);
  flex-shrink: 0;
  color: #ffffff;
  padding: 0;
}

.play-btn:hover {
  transform: scale(1.06);
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.play-btn:active {
  transform: scale(0.96);
}

.play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.play-icon.playing {
  margin-left: 0;
}

.audio-controls {
  margin-top: 0;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 32px;
}

.progress-bar-bg {
  flex: 1;
  height: 6px;
  background: #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-color);
  border-radius: 9999px;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

/* Waveform Timeline Styling (SoundCloud Style) */
.waveform-timeline {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  cursor: pointer;
  padding: 0 2px;
  position: relative;
  user-select: none;
}

.waveform-bar {
  flex: 1;
  background: var(--panel-border);
  margin: 0 1px;
  border-radius: 2px;
  height: 20%; /* Fallback height */
  transition: background-color 0.15s ease, transform 0.15s ease;
  transform-origin: bottom;
}

/* Hover effect: make unplayed bars slightly brighter */
.waveform-timeline:hover .waveform-bar:not(.active) {
  background: #cbd5e1;
}

html.dark-mode .waveform-timeline:hover .waveform-bar:not(.active) {
  background: #4b5563;
}

/* Played portion is highlighted in main brand blue */
.waveform-bar.active {
  background: var(--primary-color);
}

html.dark-mode .waveform-bar.active {
  background: #60a5fa; /* Cool sky blue for dark mode active */
}

/* Hover scrub highlight */
.waveform-bar.hover-active:not(.active) {
  background: rgba(37, 99, 235, 0.4);
}

html.dark-mode .waveform-bar.hover-active:not(.active) {
  background: rgba(96, 165, 250, 0.4);
}

/* Bounce animation when playing */
@keyframes waveBounce {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.3);
  }
}

.waveform-timeline.playing .waveform-bar.active {
  animation: waveBounce 1.2s ease-in-out infinite;
}

/* Stagger animation delays for a natural wave pattern */
.waveform-timeline.playing .waveform-bar.active:nth-child(3n) {
  animation-delay: 0.1s;
}
.waveform-timeline.playing .waveform-bar.active:nth-child(3n+1) {
  animation-delay: 0.3s;
}
.waveform-timeline.playing .waveform-bar.active:nth-child(3n+2) {
  animation-delay: 0.5s;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.speed-control {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: auto;
}

.regenerate-btn, .linkedin-btn, .download-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
  width: 100%;
}

.regenerate-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  color: var(--text-main);
  box-shadow: 0 0 12px var(--primary-glow);
}

.linkedin-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: #0a66c2; /* LinkedIn Blue */
  color: #00f0ff;
  box-shadow: 0 0 12px rgba(10, 102, 194, 0.2);
}

.download-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  color: var(--text-main);
  box-shadow: 0 0 12px var(--primary-glow);
}

.linkedin-btn:disabled, .download-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.01);
  border-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
}

.speed-control select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}

/* Wave Visualizer */
.wave-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.bar {
  width: 3px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 9999px;
  transition: height 0.1s ease;
}

.wave-visualizer.playing .bar-1 { animation: bounce 0.6s ease infinite alternate; }
.wave-visualizer.playing .bar-2 { animation: bounce 0.8s ease infinite alternate 0.1s; }
.wave-visualizer.playing .bar-3 { animation: bounce 0.5s ease infinite alternate 0.2s; }
.wave-visualizer.playing .bar-4 { animation: bounce 0.7s ease infinite alternate 0.15s; }
.wave-visualizer.playing .bar-5 { animation: bounce 0.9s ease infinite alternate 0.3s; }
.wave-visualizer.playing .bar-6 { animation: bounce 0.6s ease infinite alternate 0.05s; }
.wave-visualizer.playing .bar-7 { animation: bounce 0.8s ease infinite alternate 0.25s; }
.wave-visualizer.playing .bar-8 { animation: bounce 0.5s ease infinite alternate 0.1s; }

@keyframes bounce {
  0% { height: 4px; }
  100% { height: 24px; }
}

/* Brief Content Card */
.brief-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.brief-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding-bottom: 0.35rem;
  position: relative;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: var(--primary-color);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.tab-content::-webkit-scrollbar {
  width: 4px;
}
.tab-content::-webkit-scrollbar-track {
  background: transparent;
}
.tab-content::-webkit-scrollbar-thumb {
  background: var(--text-dark);
  border-radius: 2px;
}

.tab-content.hidden {
  display: none;
}

/* Markdown Rendering */
.markdown-body {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.85rem;
  margin-bottom: 0.4rem;
}

.markdown-body h1 {
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.2rem;
}

.markdown-body h2 {
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.15rem;
}

.markdown-body h3 {
  font-size: 0.95rem;
}

.markdown-body ul {
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.markdown-body li {
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.markdown-body strong {
  color: var(--primary-color);
  font-weight: 600;
}

.markdown-body p {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Intersections layout */
.intersections-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intersection-card, .sector-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  margin-bottom: 0.75rem;
}

.intersection-card:hover, .sector-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

.intersection-card::before, .sector-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-color);
}

.sector-card h1 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

.sector-card ul {
  margin-bottom: 0;
  margin-left: 1.25rem;
}

.sector-card li {
  margin-bottom: 0.25rem;
}

.sector-card li:last-child {
  margin-bottom: 0;
}

.intersection-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(37, 99, 235, 0.06);
  position: absolute;
  top: 0.5rem;
  right: 1rem;
}

.intersection-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-main);
  position: relative;
  z-index: 2;
}

/* Loading & Error states */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}

.no-brief-state, .no-archives {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.no-brief-state h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* Loader Overlay Screen */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 400px;
  padding: 2rem;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-color);
  border-right-color: var(--primary-color);
  animation: spin 1s infinite linear;
}

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

.loader-content h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, white, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loader-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Modal overlays (for local server warnings) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 450px;
  padding: 2rem;
  margin: 1.5rem;
  border: 1px solid #cbd5e1;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #ffffff;
  border-radius: 8px;
}

.modal-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.modal-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.code-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 1.05rem;
  color: #10b981; /* Green text */
  text-align: center;
  font-weight: 600;
}

.modal-help {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

.modal-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Responsive */
@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }
  .app-container {
    height: auto;
    max-height: none;
    overflow: auto;
    padding: 1rem;
  }
  .main-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: auto;
  }
  .content-panel {
    order: 1; /* Content first */
    grid-template-columns: 1fr;
    height: auto;
  }
  .sidebar-panel {
    order: 2; /* Archive sidebar below content */
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    margin-top: 1.5rem;
  }
  .player-card {
    height: auto;
    overflow: visible;
  }
  .brief-card {
    height: auto;
    overflow: visible;
  }
  .tab-content {
    height: auto;
    overflow: visible;
  }
  .app-header {
    height: auto !important;
    padding: 1rem !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
  }
  .logo-area {
    width: 100%;
    justify-content: center;
  }
  .header-right {
    display: none !important; /* Hide profile status on mobile/tablet to save space */
  }
  .header-player {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .view-switcher-container {
    width: 100%;
  }
  .view-btn {
    flex: 1;
    text-align: center;
  }
}

/* LinkedIn Publisher Console Modal Styles */
.linkedin-modal-content {
  width: 90%;
  max-width: 850px;
  padding: 1.5rem;
  margin: 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #0a66c2; /* LinkedIn Blue */
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

.linkedin-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.linkedin-post-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.linkedin-post-section h4, .linkedin-carousel-section h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.textarea-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

#linkedin-post-text {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.85rem;
  color: #334155;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: none;
  height: 300px;
  outline: none;
  transition: border-color 0.2s;
}

#linkedin-post-text:focus {
  border-color: #0a66c2;
}

.copy-btn {
  background: #0a66c2;
  border: none;
  color: white;
  padding: 0.65rem;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #004182;
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.2);
}

.linkedin-carousel-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.carousel-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.carousel-card {
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.carousel-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-heading);
  line-height: 1.2;
}

.author-title {
  font-size: 0.65rem;
  color: #0a66c2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.carousel-page-indicator {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 99px;
}

.carousel-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0;
}

#carousel-slide-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
  margin: 0;
  transition: opacity 0.15s ease-in-out;
}

.carousel-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.5rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.carousel-arrow {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

/* Modal Animation */
.animate-zoom {
  animation: animatezoom 0.3s var(--ease-out);
}

@keyframes animatezoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive Overrides */
@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }
  .app-container {
    height: auto;
    max-height: none;
    overflow: auto;
    padding: 1rem;
  }
  .main-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: auto;
  }
  .content-panel {
    order: 1; /* Content first */
    grid-template-columns: 1fr;
    height: auto;
  }
  .sidebar-panel {
    order: 2; /* Archive sidebar below content */
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    margin-top: 1.5rem;
  }
  .player-card {
    height: auto;
    overflow: visible;
  }
  .brief-card {
    height: auto;
    overflow: visible;
  }
  .tab-content {
    height: auto;
    overflow: visible;
  }
  .app-header {
    height: auto !important;
    padding: 1rem !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
  }
  .logo-area {
    width: 100%;
    justify-content: center;
  }
  .header-right {
    display: none !important; /* Hide profile status on mobile/tablet to save space */
  }
  .header-player {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .view-switcher-container {
    width: 100%;
  }
  .view-btn {
    flex: 1;
    text-align: center;
  }
  
  /* LinkedIn Console Mobile Layout */
  .linkedin-modal-content {
    width: 95%;
    max-width: none;
  }
  .linkedin-workspace {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .carousel-viewport {
    width: 100%;
    justify-content: space-between;
  }
  .carousel-card {
    flex-grow: 1;
    max-width: 280px;
    height: 280px;
  }
  #carousel-slide-text {
    font-size: 1rem;
  }
}

/* Header Player Styles */
.header-player {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
}

.header-player-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.header-player .player-play-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  flex-shrink: 0;
}

.header-player .player-ctrl-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.header-player .player-ctrl-btn:hover {
  color: #ffffff;
  transform: scale(1.1);
}

.header-player .player-ctrl-btn svg {
  width: 16px;
  height: 16px;
}

.header-player .play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  color: #0b1329;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.header-player .play-btn:hover {
  transform: scale(1.08);
  background: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
}

.header-player .play-btn.playing {
  box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px var(--primary-color);
  animation: activePulse 2s infinite ease-in-out;
}

.header-player .play-btn.playing:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #0f172a, 0 0 0 5px var(--primary-color);
}

@keyframes activePulse {
  0% {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px var(--primary-color);
  }
  50% {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 6px rgba(37, 99, 235, 0.4);
  }
  100% {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px var(--primary-color);
  }
}

.header-player .play-icon svg {
  width: 14px;
  height: 14px;
}

.header-player-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
  min-width: 0;
}

.header-player .progress-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.header-player .time-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace;
  min-width: 28px;
}

.header-player .progress-bar-bg {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}

.header-player .progress-bar-bg:hover {
  height: 6px;
}

.header-player .progress-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  width: 0%;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.header-actions select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  outline: none;
}

.header-actions select:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.action-buttons-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  width: 140px;
}

.action-buttons-compact button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-buttons-compact button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-buttons-compact .linkedin-btn {
  background: #0077b5;
  border-color: #0077b5;
}

.action-buttons-compact .linkedin-btn:hover:not(:disabled) {
  background: #005a8a;
  border-color: #005a8a;
}

.action-buttons-compact .linkedin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.header-player .wave-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-right: 0.25rem;
}

.header-player .wave-visualizer .bar {
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
}

.header-player .wave-visualizer.playing .bar {
  background: var(--primary-color);
}

.header-player .progress-bar-fill {
  position: relative;
}

.header-player .progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s;
}

.header-player .progress-bar-bg:hover .progress-bar-fill::after {
  opacity: 1;
}

/* Animations & Transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-content {
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-pulse {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* Chapters Dropdown Popover (Option 1) */
.chapters-dropdown-container {
  position: relative;
  display: inline-block;
}

.chapters-menu-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  user-select: none;
}

html.dark-mode .chapters-menu-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.chapters-menu-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

html.dark-mode .chapters-menu-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: #60a5fa;
  color: #60a5fa;
}

.chapters-menu-btn.active {
  background: var(--primary-color) !important;
  color: #ffffff !important;
  border-color: var(--primary-color) !important;
}

.chapters-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  max-height: 360px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInPop 0.15s ease-out;
}

html.dark-mode .chapters-popover {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.chapters-popover.open {
  display: flex;
}

@keyframes fadeInPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chapters-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chapters-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
}

.chapters-close-btn:hover {
  color: var(--text-main);
}

.chapters-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0.35rem;
  max-height: 300px;
}

.chapters-list::-webkit-scrollbar {
  width: 4px;
}

.chapters-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  gap: 0.5rem;
}

.chapter-item:hover {
  background: #f1f5f9;
}

html.dark-mode .chapter-item:hover {
  background: #1e293b;
}

.chapter-item.active {
  background: rgba(37, 99, 235, 0.12) !important;
}

html.dark-mode .chapter-item.active {
  background: rgba(59, 130, 246, 0.18) !important;
}

.chapter-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.chapter-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-item.active .chapter-item-title {
  color: var(--primary-color);
}

html.dark-mode .chapter-item.active .chapter-item-title {
  color: #60a5fa;
}

.chapter-item-time {
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

html.dark-mode .chapter-item-time {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.chapter-item.active .chapter-item-time {
  background: var(--primary-color);
  color: #ffffff;
}

html.dark-mode .chapter-item.active .chapter-item-time {
  background: #3b82f6;
  color: #ffffff;
}

