:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111622;
  --bg-surface: #182030;
  --bg-surface-hover: #222c42;
  --bg-elevated: #28344e;
  --border-color: #26334d;
  --border-light: #334466;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --aws-orange: #ff9900;
  --aws-orange-hover: #ffaa22;
  --aws-blue: #0073bb;
  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-purple: #a855f7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --sidebar-width: 390px;
  --header-height: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  z-index: 50;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #ff9900, #ff6600);
  border-radius: var(--radius-md);
  color: #000;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.25);
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

.header-center {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--aws-orange);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.progress-text strong {
  color: var(--aws-orange);
}

.progress-bar-bg {
  width: 110px;
  height: 8px;
  background: var(--bg-surface-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9900, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* App Main Container */
.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left Sidebar - Curriculum */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar-filter-bar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.sidebar-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--aws-orange);
  color: #000;
  border-color: var(--aws-orange);
}

.curriculum-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.curriculum-list::-webkit-scrollbar {
  width: 6px;
}
.curriculum-list::-webkit-scrollbar-track {
  background: transparent;
}
.curriculum-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

/* Section Accordion */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.section-card.active-section {
  border-color: var(--border-light);
}

.section-header {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: var(--bg-surface);
  transition: var(--transition);
}

.section-header:hover {
  background: var(--bg-surface-hover);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.section-num {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--aws-orange);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.section-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 6px;
}

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

.section-badge.completed {
  color: var(--accent-green);
}

.chevron-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.section-card.open .chevron-icon {
  transform: rotate(180deg);
}

.section-lessons {
  display: none;
  background: rgba(10, 13, 20, 0.5);
  border-top: 1px solid var(--border-color);
}

.section-card.open .section-lessons {
  display: block;
}

/* Lesson Item */
.lesson-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(38, 51, 77, 0.4);
  cursor: pointer;
  gap: 9px;
  transition: var(--transition);
}

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

.lesson-item:hover {
  background: var(--bg-surface-hover);
}

.lesson-item.active {
  background: rgba(255, 153, 0, 0.14);
  border-left: 3px solid var(--aws-orange);
}

.lesson-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  transition: var(--transition);
  background: transparent;
}

.lesson-checkbox:hover {
  border-color: var(--accent-green);
}

.lesson-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.lesson-icon {
  font-size: 13px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.lesson-title-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lesson-item.active .lesson-title-text {
  color: #fff;
  font-weight: 600;
}

.lesson-bookmark-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}

.lesson-bookmark-btn:hover {
  color: var(--accent-yellow);
}

.lesson-bookmark-btn.bookmarked {
  color: var(--accent-yellow);
}

/* Right Content Area - IMPORTANT: block layout prevents flex-shrinking children */
.content-area {
  flex: 1;
  display: block;
  overflow-y: auto;
  background: var(--bg-primary);
  padding: 16px 24px 40px;
}

.content-area::-webkit-scrollbar {
  width: 8px;
}
.content-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

/* Lesson Control Header */
.lesson-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.current-lesson-meta {
  flex: 1;
  min-width: 240px;
  overflow: hidden;
}

.current-section-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--aws-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.current-lesson-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-light);
}

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

.btn-primary {
  background: var(--aws-orange);
  color: #000;
  border-color: var(--aws-orange);
}

.btn-primary:hover:not(:disabled) {
  background: var(--aws-orange-hover);
  box-shadow: 0 4px 14px rgba(255, 153, 0, 0.3);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
}

/* Player Stage */
.player-container {
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 66vh;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Hide browser native subtitle tracks so our custom dual-subtitle overlay renders cleanly */
video::cue {
  opacity: 0 !important;
}
video::-webkit-media-text-track-container {
  display: none !important;
}

/* Custom Subtitle Overlay */
.custom-subtitle-overlay {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 900px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 20;
  text-align: center;
}

.sub-box-primary {
  background: rgba(8, 11, 18, 0.86);
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 5px 14px;
  border-radius: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
}

.sub-box-secondary {
  background: rgba(8, 11, 18, 0.82);
  color: #38bdf8;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.35;
  padding: 3px 12px;
  border-radius: 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  max-width: 100%;
}

/* Player Helper Toolbar */
.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sub-pill-group, .speed-pill-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.pill-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.pill-btn.active {
  background: var(--aws-orange);
  color: #000;
}

.toggle-switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-switch-label input {
  accent-color: var(--aws-orange);
  cursor: pointer;
}

/* Non-video content view (Quiz / Doc / PDF) */
.non-video-view {
  width: 100%;
  height: 74vh;
  min-height: 520px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.non-video-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
}

.non-video-iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #111622;
}

/* Banner for attached resources (external links / PDFs) */
.attached-resource-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  gap: 12px;
}

.attached-resource-banner span {
  font-size: 13px;
  color: var(--text-primary);
}

/* Tabs Section */
.tabs-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tab-header-nav {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 12px;
  flex-wrap: wrap;
}

.tab-nav-item {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-nav-item:hover {
  color: #fff;
}

.tab-nav-item.active {
  color: var(--aws-orange);
  border-bottom-color: var(--aws-orange);
}

.tab-content {
  padding: 16px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Transcript Tab */
.transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.transcript-search {
  padding: 7px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 12.5px;
  width: 260px;
}

.transcript-search:focus {
  outline: none;
  border-color: var(--aws-orange);
}

.transcript-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 6px;
  position: relative;
}

.transcript-list::-webkit-scrollbar {
  width: 6px;
}
.transcript-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.transcript-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.transcript-row:hover {
  background: var(--bg-surface-hover);
}

.transcript-row.active {
  background: rgba(255, 153, 0, 0.16);
  border-left: 3px solid var(--aws-orange);
}

.cue-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.cue-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.cue-text mark {
  background: rgba(255, 153, 0, 0.45);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Notes Tab */
.notes-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-editor {
  width: 100%;
  height: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

.notes-editor:focus {
  outline: none;
  border-color: var(--aws-orange);
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.notes-status {
  font-size: 12px;
  color: var(--accent-green);
}

/* Cheatsheet / Hotkeys */
.hotkeys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.hotkey-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hotkey-card span {
  font-size: 13px;
  color: var(--text-secondary);
}

.kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* Empty / Loading State */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-secondary);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border-color);
  border-top-color: var(--aws-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Study Mode Switcher Bar */
.study-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-switch-group {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.mode-switch-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-switch-btn.active {
  background: var(--aws-orange);
  color: #000;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.25);
}

.mode-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Text Study Reader View */
.text-study-view {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 15;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.reader-badge {
  background: rgba(255, 153, 0, 0.14);
  color: var(--aws-orange);
  border: 1px solid rgba(255, 153, 0, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 11.5px;
}

.reader-body {
  padding: 28px 36px;
  max-width: 1020px;
  margin: 0 auto;
  font-size: var(--reader-font-size, 15.5px);
  line-height: 1.75;
}

/* Key Terms Grid inside Text Reader */
.reader-section-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.reader-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--aws-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.glossary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.glossary-term {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.glossary-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Key Takeaways List */
.takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.takeaways-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-primary);
  font-size: 0.96em;
  line-height: 1.6;
}

.takeaways-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--aws-orange);
  font-weight: bold;
}

/* Article Paragraphs */
.article-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.article-para-card {
  background: rgba(24, 32, 48, 0.55);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  transition: var(--transition);
}

.article-para-card:hover {
  border-color: var(--border-light);
  background: rgba(24, 32, 48, 0.85);
}

.para-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.para-num {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.para-jump-btn {
  background: var(--bg-elevated);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.para-jump-btn:hover {
  background: var(--aws-orange);
  color: #000;
  border-color: var(--aws-orange);
}

.para-content-single {
  color: var(--text-primary);
  text-align: justify;
}

.para-content-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .para-content-dual {
    grid-template-columns: 1fr;
  }
}

.para-col-vi {
  color: var(--text-primary);
  padding-right: 12px;
  border-right: 1px dashed var(--border-color);
}

.para-col-en {
  color: var(--text-secondary);
  font-size: 0.94em;
}

.aws-kw {
  color: #fbbf24;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.1);
  padding: 0 4px;
  border-radius: 3px;
}

/* Chapter E-book TOC & Divider */
.chapter-toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
}

.chapter-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.chapter-toc-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-toc-link:hover {
  border-color: var(--aws-orange);
  color: var(--aws-orange);
}

.chapter-article-block {
  margin-bottom: 42px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border-color);
}

.chapter-article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

.chapter-article-header h3 {
  font-size: 20px;
  color: var(--aws-orange);
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
