/* ==========================================================================
   HIGH-DENSITY DOCUMENTATION, HEADING SYSTEM & HUB COMPONENTS
   ========================================================================== */

/* Page 1: Global Courses Selection Hub (Full-Page View) */
.global-courses-hub {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.global-hub-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.5rem;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hub-header-actions {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hub-logo-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 1.5px;
}

.hub-logo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: var(--tracking-wordmark);
  text-transform: uppercase;
}


/* Courses Directory & Cards */
.courses-directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.directory-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--text-primary);
}

.directory-subtitle {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Carousel Side Navigation Controls & 3-Cards Row Layout */
.global-courses-carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.carousel-side-btn {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
  user-select: none;
}

.carousel-side-btn:hover:not(:disabled) {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-hover-bg);
  transform: scale(1.05);
}

.carousel-side-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.carousel-side-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  border-color: var(--hairline);
}

.carousel-side-btn .svg-icon {
  width: 20px;
  height: 20px;
}

.global-courses-carousel-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 0.5rem 0 1rem;
}

.global-courses-track {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  width: 100%;
  padding: 0.25rem 0 0.75rem;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show EXACTLY 3 cards per row on Desktop with Uniform Layout */
.global-course-card {
  flex: 0 0 calc((100% - 3rem) / 3);
  width: calc((100% - 3rem) / 3);
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: border-color var(--speed-fast) ease, background var(--speed-fast) ease;
}

@media (max-width: 1024px) {
  /* Show 2 cards per row on Tablet */
  .global-course-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
    width: calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 640px) {
  /* Show 1 card per row on Mobile */
  .global-courses-carousel-container {
    gap: 0.5rem;
  }
  .carousel-side-btn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
  .global-course-card {
    flex: 0 0 100%;
    width: 100%;
  }
}

.global-course-card:not(.disabled):hover {
  border-color: var(--hairline-strong);
  background: var(--surface-elevated);
}

.global-course-card.disabled {
  opacity: 0.45;
  background: var(--surface-soft);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.course-provider-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
  color: var(--text-muted);
  text-transform: uppercase;
}

.course-title-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.25;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.course-description-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.card-bottom-section {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-stats-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot-sep {
  opacity: 0.4;
}

.btn-enter-course {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: var(--tracking-btn);
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  transition: all var(--speed-fast) ease;
}

.btn-enter-course:hover:not(.disabled) {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-hover-bg);
}

.btn-enter-course.disabled {
  background: transparent;
  color: var(--text-muted-soft);
  border: 1px solid var(--hairline);
  cursor: not-allowed;
  font-weight: 400;
}

/* Page 2: Article Canvas — single reading column, consistent left/right edges */
.editorial-article {
  background: transparent;
  border: none;
  padding: 0;
  max-width: min(72ch, 100%);
  width: 100%;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}

/* Article Title */
.article-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.article-summary {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 420;
  color: var(--text-secondary);
  line-height: 1.72;
}

/* Article Body */
.article-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 420;
  line-height: 1.78;
  letter-spacing: 0.01em;
  color: var(--text-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--speed-fast) ease;
}

.article-body a:hover {
  opacity: 0.8;
}

/* Headings */
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: var(--tracking-headline);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-top: 3.5rem;
  margin-bottom: 0.75rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.5rem;
}

/* Remove the big top margin when a heading immediately follows another heading */
.article-body h2 + h3 {
  margin-top: 1rem;
}

/* ── Paragraphs: loose line-height, moderate block spacing ─── */
.article-body p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--text-body);
}

/* Reduce gap when paragraph immediately precedes a list */
.article-body p + ul,
.article-body p + ol {
  margin-top: -0.5rem;
}

/* ── Bullet & Numbered Lists: compact but distinct ──────────── */
.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-body li {
  line-height: 1.65;
  margin-bottom: 0.45rem;
  color: var(--text-body);
}

.article-body li::marker {
  color: var(--text-muted);
}

.article-body li:last-child {
  margin-bottom: 0;
}

/* Callout Box (Bugatti Left-Accent Minimalist Border) */
.editorial-quote {
  border-left: 2px solid var(--accent-ice);
  padding: 0.85rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--surface-soft);
  border-radius: var(--radius-none);
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 420;
  color: var(--text-body);
  line-height: 1.65;
}

/* Tag Grid */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tag-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  padding: 1.25rem;
  transition: border-color var(--speed-fast) ease;
}

.tag-card:hover {
  border-color: var(--hairline-strong);
}

.tag-card code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: #c3d9f3;
  background: #141824;
  padding: 0.18rem 0.48rem;
  border-radius: var(--radius-sm);
  border: 1px solid #26334d;
}

.tag-card p {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-body);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* Floating Action Button (FAB) & Live Code Sandbox Drawer */
.sandbox-fab-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-full);
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
}

.sandbox-fab-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-hover-bg);
}

.sandbox-fab-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

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

.fab-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Resizer Handles */
.sandbox-resize-handle {
  position: absolute;
  z-index: 60;
  transition: background 0.2s ease;
}

.sandbox-resize-handle.handle-left {
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}

.sandbox-resize-handle.handle-left:hover,
.sandbox-resize-handle.handle-left:active {
  background: rgba(195, 217, 243, 0.3);
}

.sandbox-resize-handle.handle-top {
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
}

.sandbox-resize-handle.handle-top:hover,
.sandbox-resize-handle.handle-top:active {
  background: rgba(195, 217, 243, 0.3);
}

.sandbox-resize-handle.handle-top-left {
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 70;
  border-top-left-radius: var(--radius-none);
}

.sandbox-resize-handle.handle-top-left::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--link);
  border-left: 2px solid var(--link);
}

.sandbox-resize-handle.handle-top-left:hover,
.sandbox-resize-handle.handle-top-left:active {
  background: rgba(195, 217, 243, 0.5);
}

.sandbox-drawer {
  position: fixed;
  bottom: 5.25rem;
  right: 2rem;
  width: 680px;
  max-width: calc(100vw - 3rem);
  height: 520px;
  max-height: calc(100vh - 7rem);
  min-width: 380px;
  min-height: 320px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-none);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.sandbox-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.sandbox-drawer-header {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--hairline);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sandbox-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-primary);
}

.sandbox-title svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sandbox-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sandbox-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sandbox-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.sandbox-btn.run-btn {
  background: transparent;
  color: var(--link);
  border-color: var(--link);
}

.sandbox-btn.run-btn:hover {
  background: var(--link);
  color: #000000;
}

.sandbox-btn.close-btn {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
}

.sandbox-drawer-body {
  display: grid;
  grid-template-rows: 1fr 6px 1fr;
  flex: 1;
  height: calc(100% - 45px);
  overflow: hidden;
}

.sandbox-editor-wrapper {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.sandbox-resizer {
  height: 6px;
  background: var(--hairline);
  cursor: row-resize;
  transition: background 0.15s ease;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sandbox-resizer::after {
  content: "";
  width: 36px;
  height: 2px;
  background: var(--hairline-strong);
  border-radius: 2px;
  transition: background 0.15s ease;
}

.sandbox-resizer:hover,
.sandbox-resizer:active {
  background: var(--hairline-strong);
}

.sandbox-resizer:hover::after,
.sandbox-resizer:active::after {
  background: var(--link);
}

.sandbox-textarea {
  width: 100%;
  height: 100%;
  background: var(--surface-card);
  color: var(--text-body-strong);
  border: none;
  outline: none;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  resize: none;
  caret-color: #ffffff;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.sandbox-output-wrapper {
  background: var(--surface-soft);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sandbox-output-header {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}

.sandbox-terminal-output {
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e4e4e7;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
  flex: 1;
}

.sandbox-terminal-output .term-info { color: var(--link); }
.sandbox-terminal-output .term-out { color: #4ade80; font-weight: 600; }
.sandbox-terminal-output .term-success { color: #5fa657; }
.sandbox-terminal-output .term-err { color: #f87171; font-weight: 700; }
.sandbox-terminal-output .term-warn { color: var(--warning); font-weight: 700; }
.sandbox-terminal-output .term-muted { color: var(--text-muted-soft); }

.sandbox-iframe-preview {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

@media (max-width: 768px) {
  .sandbox-drawer {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: 5rem;
  }
  .sandbox-fab-btn {
    right: 1rem;
    bottom: 1.5rem;
  }
}

/* Quiz Engine */
.quiz-hub {
  max-width: 1080px;
  width: 100%;
}

.quiz-score-badge {
  margin-top: 1.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.quiz-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
}

.quiz-question-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.quiz-question-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.35;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.option-btn {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-none);
  text-align: left;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

.option-btn:hover {
  background: var(--surface-hover);
  border-color: var(--hairline-strong);
  color: var(--text-primary);
}

.option-btn.selected {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 500;
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(95, 166, 87, 0.15);
  color: var(--text-primary);
}

.option-btn.incorrect {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  color: var(--text-muted);
}

.quiz-explanation {
  margin-top: 1.25rem;
}

.explain-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-soft);
  border-left: 2px solid var(--text-primary);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-body-strong);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: var(--tracking-btn);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

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

/* ── Article Tables & Editorial Table System ── */
.article-body table,
.editorial-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  background: var(--surface-card);
  font-size: 0.9rem;
}

.article-body th,
.editorial-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  color: var(--text-primary);
  background: var(--surface-soft);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  text-align: left;
  white-space: nowrap;
}

.article-body th:last-child,
.editorial-table th:last-child {
  border-right: none;
}

.article-body td,
.editorial-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  color: var(--text-body);
  font-family: var(--font-serif);
  line-height: 1.6;
  vertical-align: top;
}

.article-body td:first-child,
.editorial-table td:first-child {
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-body-strong);
}

.article-body td:last-child,
.editorial-table td:last-child {
  border-right: none;
}

.article-body tr:last-child td,
.editorial-table tr:last-child td {
  border-bottom: none;
}

.article-body tr:nth-child(even),
.editorial-table tr:nth-child(even) {
  background: var(--surface-soft);
}

.article-body tr:hover,
.editorial-table tr:hover {
  background: var(--surface-hover);
}

.article-body td code,
.editorial-table td code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #141824;
  border: 1px solid #26334d;
  padding: 0.18rem 0.48rem;
  border-radius: var(--radius-sm);
  color: #c3d9f3;
  white-space: nowrap;
  word-break: normal;
  display: inline-block;
}

/* ── Interactive DevTools Layout Inspector (Bugatti Luxury Monochrome) ── */
.devtools-mockup {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  background: var(--surface-card);
  overflow: hidden;
  margin: 2.5rem 0;
}

.devtools-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  color: var(--text-primary);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hairline-strong);
  display: inline-block;
}

.browser-address {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  padding: 0.25rem 1rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 45%;
  justify-content: center;
}

.browser-right-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted-soft);
  font-weight: 400;
}

.devtools-toolbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-card);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.toolbar-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-muted);
}

.mode-btn-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mode-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--text-body);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

.mode-btn:hover {
  background: var(--surface-hover);
  border-color: #ffffff;
  color: #ffffff;
}

.mode-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

.devtools-stage-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 290px;
}

@media (max-width: 768px) {
  .devtools-stage-split {
    grid-template-columns: 1fr;
  }
}

.viewport-stage {
  padding: 1.5rem;
  background: var(--surface-card);
  border-right: 1px solid var(--hairline);
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.stage-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: var(--tracking-mono);
  font-weight: 400;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.layout-box-container {
  flex: 1;
  width: 100%;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1rem;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-none);
  background: var(--surface-soft);
}

/* Layout Modes */
.layout-box-container.mode-block {
  display: block;
}
.layout-box-container.mode-block .inspect-box {
  display: block;
  width: 100%;
  margin-bottom: 0.65rem;
}

.layout-box-container.mode-inline {
  display: block;
  line-height: 2.2;
}
.layout-box-container.mode-inline .inspect-box {
  display: inline;
  padding: 0.3rem 0.75rem;
  margin-right: 0.5rem;
  white-space: nowrap;
}
.layout-box-container.mode-inline .inspect-box .box-tag {
  display: inline;
  margin-right: 0.35rem;
}
.layout-box-container.mode-inline .inspect-box .box-text {
  display: inline;
}

.layout-box-container.mode-inline-block {
  display: block;
}
.layout-box-container.mode-inline-block .inspect-box {
  display: inline-block;
  width: calc(33.33% - 0.5rem);
  margin-right: 0.5rem;
  vertical-align: top;
}
.layout-box-container.mode-inline-block .inspect-box:last-child {
  margin-right: 0;
}

.layout-box-container.mode-flex {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 0.75rem;
}
.layout-box-container.mode-flex .inspect-box {
  flex: 1;
}

.layout-box-container.mode-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0.75rem;
}

/* Inspector Element Box */
.inspect-box {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-none);
  padding: 0.85rem;
  box-sizing: border-box;
  position: relative;
  transition: all 0.2s ease;
}

.inspect-box:hover {
  border-color: #ffffff;
}

.inspect-box .box-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.inspect-box .box-text {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* DevTools Inspector Panel */
.devtools-panel {
  background: var(--surface-soft);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}

.panel-tabs .tab-btn {
  padding: 0.6rem 0.95rem;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.panel-tabs .tab-btn:hover {
  color: #ffffff;
}

.panel-tabs .tab-btn.active {
  color: #ffffff;
  background: var(--surface-soft);
  border-bottom: 2px solid #ffffff;
}

.panel-body {
  padding: 1.25rem;
  flex: 1;
  position: relative;
}

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

.css-rule-line {
  color: var(--text-body-strong);
}

.css-property-group {
  padding-left: 1rem;
  line-height: 1.7;
}

.css-property-group .prop {
  color: var(--text-muted);
}

.css-property-group .val {
  color: #ffffff;
  font-weight: 500;
}

.devtools-explanation {
  margin-top: 1.5rem;
  padding: 0.85rem 1.15rem;
  background: var(--surface-card);
  border-left: 2px solid #ffffff;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* DOM Tree View Tab */
.dom-tree-view {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
}
.dom-node {
  color: var(--text-muted);
}
.dom-children {
  padding-left: 1.25rem;
}
.dom-tree-view .tag-name {
  color: #ffffff;
  font-weight: 500;
}
.dom-tree-view .attr-name {
  color: var(--text-muted-soft);
}
.dom-tree-view .attr-val {
  color: var(--link);
}

/* Concentric Box Model Diagram Tab */
.boxmodel-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}
.bm-margin {
  background: var(--surface-soft);
  border: 1px dashed var(--hairline-strong);
  padding: 0.75rem;
  text-align: center;
}
.bm-border {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  padding: 0.75rem;
}
.bm-padding {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 0.75rem;
}
.bm-content {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-none);
}
.bm-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   PORTFOLIO STOREFRONT SHOWCASE CALL-TO-ACTION BANNER
   (Bugatti Luxury Design System: Flat 0px edges, hairline 1px border, monospace tracking)
   ========================================================================== */
.portfolio-cta-banner {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  padding: 2rem 2.25rem;
  margin: 2.5rem 0;
  border-radius: var(--radius-none);
  position: relative;
  overflow: hidden;
  transition: border-color var(--speed-normal) var(--ease-editorial);
}
.portfolio-cta-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent-ice, #c3d9f3);
}
.portfolio-cta-banner:hover {
  border-color: var(--text-muted);
}
.portfolio-cta-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.portfolio-cta-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--accent-ice, #c3d9f3);
}
.portfolio-cta-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  letter-spacing: 1px;
}
.portfolio-cta-heading {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: var(--tracking-headline);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.portfolio-cta-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}
.portfolio-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: var(--tracking-btn);
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-none);
  text-decoration: none;
  transition: all var(--speed-normal) var(--ease-editorial);
}
.portfolio-cta-link:hover {
  background: transparent;
  color: var(--text-primary);
}

/* ==========================================================================
   INTERACTIVE QUIZ & LIVE COMPONENT PREVIEW CARDS (LIGHT/DARK ADAPTIVE)
   ========================================================================== */
.interactive-quiz-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.25rem 0;
  border-radius: var(--radius-none);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all var(--speed-fast) var(--ease-editorial);
}

.quiz-option-label:hover {
  background: var(--surface-hover);
  border-color: var(--hairline-strong);
}

.quiz-option-label input[type="radio"],
.quiz-option-label input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--link);
  cursor: pointer;
}

.quiz-answer-details {
  margin: 1rem 0 2rem 0;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-none);
}

.quiz-answer-details summary {
  cursor: pointer;
  color: var(--link);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  user-select: none;
}

.quiz-answer-details summary:hover {
  text-decoration: underline;
}

.quiz-answer-details .answer-content {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--hairline);
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.6;
}

.live-preview-box {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-none);
}

.live-preview-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-preview-content {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  padding: 1.5rem;
  border-radius: var(--radius-none);
  color: var(--text-primary);
}

/* Header Controls — Embedded Glass Capsule (Bugatti Minimalist) */
.global-controls {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 3px 5px;
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  pointer-events: all;
  transition: border-color var(--speed-fast) ease, box-shadow var(--speed-fast) ease;
}

[data-theme="light"] .global-controls {
  background: rgba(245, 245, 245, 0.92);
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.global-controls:hover {
  border-color: var(--text-muted);
}

.global-controls .theme-toggle-icon-btn {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-pill) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  padding: 0 !important;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

.global-controls .theme-toggle-icon-btn:hover {
  background: var(--surface-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--hairline) !important;
  transform: none !important;
}

.global-controls-divider {
  width: 1px;
  height: 16px;
  background: var(--hairline);
  margin: 0 2px;
  flex-shrink: 0;
}

.my-learning-toggle-btn {
  position: relative !important;
}

.my-learning-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  border-radius: var(--radius-pill);
  padding: 0 3px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .my-learning-badge {
  background: #000000;
  color: #ffffff;
  border-color: #333333;
}

/* Guide Tour Overlay & Popover */
.guide-tour-container {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: all;
  overflow: hidden;
}

.guide-tour-svg-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
}

.tour-spotlight-ring {
  position: absolute;
  border: 2px solid var(--link);
  box-shadow: 0 0 24px rgba(195, 217, 243, 0.35);
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

.tour-popover-card {
  position: absolute;
  z-index: 100002;
  width: 440px;
  max-width: min(460px, calc(100vw - 32px));
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-none);
  padding: 1.15rem 1.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: all;
}

.tour-popover-inner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

[data-theme="light"] .tour-popover-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.tour-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--link);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

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

.tour-close-btn:hover {
  color: var(--text-primary);
}

.tour-popover-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.tour-popover-content {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}

.tour-popover-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--hairline-strong);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all var(--speed-fast) ease;
}

.tour-dot.active {
  width: 22px;
  background: var(--text-primary);
}

.tour-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.tour-btn-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: color var(--speed-fast) ease;
}

.tour-btn-skip:hover {
  color: var(--text-primary);
}

.tour-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tour-btn-prev {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all var(--speed-fast) ease;
}

.tour-btn-prev:hover {
  border-color: var(--hairline-strong);
  color: var(--text-primary);
}

.tour-btn-next {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all var(--speed-fast) ease;
}

.tour-btn-next:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-hover-bg);
}

@media (max-width: 768px) {
  .tour-popover-card.mobile-dock-top,
  .tour-popover-card.mobile-docked.mobile-dock-top {
    position: fixed !important;
    top: calc(0.75rem + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    padding: 0.85rem 1rem !important;
    gap: 0.45rem !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65) !important;
  }

  .tour-popover-card.mobile-dock-bottom,
  .tour-popover-card.mobile-docked {
    position: fixed !important;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    padding: 0.85rem 1rem !important;
    gap: 0.45rem !important;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.65) !important;
  }

  [data-theme="light"] .tour-popover-card.mobile-dock-top,
  [data-theme="light"] .tour-popover-card.mobile-dock-bottom,
  [data-theme="light"] .tour-popover-card.mobile-docked {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
  }

  .tour-popover-card {
    padding: 0.85rem 1rem !important;
    gap: 0.45rem !important;
  }

  .tour-popover-inner {
    gap: 0.45rem !important;
  }

  .tour-step-badge {
    font-size: 0.62rem !important;
    padding: 0.15rem 0.5rem !important;
    letter-spacing: 1px !important;
  }

  .tour-popover-title {
    font-size: 0.98rem !important;
    line-height: 1.25 !important;
  }

  .tour-popover-content {
    font-size: 0.84rem !important;
    line-height: 1.45 !important;
  }

  .tour-popover-dots {
    margin-top: 0.15rem !important;
    gap: 0.35rem !important;
  }

  .tour-dot {
    width: 6px !important;
    height: 6px !important;
  }

  .tour-dot.active {
    width: 18px !important;
  }

  .tour-popover-actions {
    margin-top: 0.2rem !important;
    padding-top: 0.45rem !important;
    gap: 0.5rem !important;
  }

  .tour-btn-skip {
    font-size: 0.68rem !important;
    padding: 0.3rem 0.4rem !important;
  }

  .tour-btn-prev,
  .tour-btn-next {
    font-size: 0.68rem !important;
    padding: 0.35rem 0.7rem !important;
  }
}

.my-learning-modal-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-none);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.my-learning-modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.my-learning-modal-item {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-none);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color var(--speed-fast) ease;
}

.my-learning-modal-item:hover {
  border-color: var(--hairline-strong);
}

.my-learning-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.my-learning-item-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.my-learning-item-desc {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}

.my-learning-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}

.my-learning-item-progress {
  flex: 1;
  min-width: 180px;
}

.btn-my-learning-action {
  padding: 0.55rem 1.25rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: var(--tracking-btn);
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--speed-fast) ease;
}

.btn-my-learning-action:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-hover-bg);
}

/* ── Auth Google Button ───────────────────────────────────── */
.auth-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: all var(--speed-fast) ease;
  white-space: nowrap;
}

.auth-google-btn:hover {
  background: var(--surface-hover);
  border-color: var(--hairline);
  transform: none;
}

.auth-google-btn .google-icon {
  flex-shrink: 0;
}

/* ── User Profile Badge & Dropdown ────────────────────────── */
.user-profile-menu-wrapper {
  position: relative;
  z-index: 50;
}

.user-profile-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 2px 8px 2px 3px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--speed-fast) ease;
  box-shadow: none;
}

.user-profile-badge-btn:hover {
  border-color: var(--hairline);
  background: var(--surface-hover);
}

.user-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.user-avatar-initials {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--accent-ice);
  color: #0b0c0e;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-profile-name {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron-icon {
  opacity: 0.6;
  transition: transform var(--speed-fast) ease;
  display: inline-flex;
  align-items: center;
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-width: calc(100vw - 1.5rem);
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  padding: 1rem;
  display: none;
  z-index: 10000;
  animation: dropdownFadeIn 0.15s ease forwards;
  box-sizing: border-box;
}

.user-dropdown-card.visible {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-header {
  padding-bottom: 0.75rem;
}

.dropdown-user-name {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dropdown-user-email {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* ── Responsive Global Controls Capsule ───────────────────── */
@media (max-width: 768px) {
  .global-controls {
    padding: 2px 4px;
    gap: 2px;
  }

  .global-controls .theme-toggle-icon-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .global-controls .theme-toggle-icon-btn .svg-icon {
    width: 14px;
    height: 14px;
  }

  /* Compact Google Button on mobile: icon only */
  .global-controls .auth-google-btn {
    padding: 0;
    width: 28px;
    height: 28px;
    justify-content: center;
    border-radius: var(--radius-pill);
  }

  .global-controls .auth-google-text {
    display: none !important;
  }

  /* Compact User Profile Button on mobile: Avatar circle only */
  .global-controls .user-profile-badge-btn {
    padding: 0;
    width: 28px;
    height: 28px;
    justify-content: center;
    border-radius: var(--radius-pill);
  }

  .global-controls .user-profile-name,
  .global-controls .dropdown-chevron-icon {
    display: none !important;
  }

  .global-controls .user-avatar-img,
  .global-controls .user-avatar-initials {
    width: 24px;
    height: 24px;
  }

  .global-controls-divider {
    height: 12px;
    margin: 0 1px;
  }

  .user-dropdown-card {
    right: 0;
    width: min(270px, calc(100vw - 1.25rem));
  }
}

@media (min-width: 769px) and (max-width: 860px) {
  .global-controls .auth-google-text,
  .global-controls .user-profile-name,
  .global-controls .dropdown-chevron-icon {
    display: none !important;
  }

  .global-controls .auth-google-btn,
  .global-controls .user-profile-badge-btn {
    padding: 0 0.35rem;
  }
}

.dropdown-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--success);
  margin-top: 0.5rem;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.dropdown-divider {
  height: 1px;
  background: var(--hairline);
  margin: 0.65rem 0;
}

.dropdown-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.25rem 0;
}

.dropdown-stat-label {
  color: var(--text-muted);
}

.dropdown-stat-value {
  color: var(--text-primary);
  font-weight: 600;
}

.dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--speed-fast) ease;
}

.dropdown-action-btn:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
  border-color: var(--hairline);
}

.dropdown-action-btn.logout-btn {
  color: #f87171;
}

.dropdown-action-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .dropdown-action-btn.logout-btn {
  color: #dc2626;
}

[data-theme="light"] .dropdown-action-btn.logout-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: #b91c1c;
}

/* ── Session Management & Bearer Token Panel ───────────────── */
.dropdown-session-box {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 0px;
  padding: 0.75rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

[data-theme="light"] .dropdown-session-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.session-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.session-shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.session-shield-badge svg {
  color: var(--accent-ice);
}

[data-theme="light"] .session-shield-badge svg {
  color: #2563eb;
}

.session-status-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(195, 217, 243, 0.1);
  border: 1px solid rgba(195, 217, 243, 0.3);
  color: var(--accent-ice);
  letter-spacing: 0.5px;
}

.session-status-tag.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

[data-theme="light"] .session-status-tag {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

[data-theme="light"] .session-status-tag.active {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.session-info-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: 1px solid var(--hairline);
  padding-top: 0.4rem;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.session-row-label {
  color: var(--text-muted);
}

.session-row-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Refresh Token Button - High-Contrast WCAG AAA */
.dropdown-session-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: 0px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

.dropdown-session-refresh-btn .refresh-icon {
  color: var(--accent-ice);
  flex-shrink: 0;
}

.dropdown-session-refresh-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-ice);
  color: var(--text-primary);
}

[data-theme="light"] .dropdown-session-refresh-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .dropdown-session-refresh-btn .refresh-icon {
  color: #2563eb;
}

[data-theme="light"] .dropdown-session-refresh-btn:hover {
  background: #f1f5f9;
  border-color: #2563eb;
  color: #1d4ed8;
}

[data-theme="dark"] .dropdown-session-refresh-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--hairline-strong);
  color: #ffffff;
}

[data-theme="dark"] .dropdown-session-refresh-btn .refresh-icon {
  color: var(--accent-ice);
}

[data-theme="dark"] .dropdown-session-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-ice);
  color: #ffffff;
}

.dropdown-session-refresh-btn.refreshing svg {
  animation: spin 0.8s linear infinite;
}

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

/* ── Session Inactivity Warning Modal ──────────────────────── */
.session-warning-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalOverlayFadeIn 0.2s ease forwards;
}

.session-warning-overlay.visible {
  display: flex;
}

.session-warning-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: 0px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  padding: 1.75rem;
  box-sizing: border-box;
}

[data-theme="light"] .session-warning-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.session-warning-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.session-warning-icon-badge {
  width: 38px;
  height: 38px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  flex-shrink: 0;
}

[data-theme="light"] .session-warning-icon-badge {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.session-warning-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.session-warning-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.session-warning-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.session-warning-desc {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
}

.session-countdown-box {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 0px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

[data-theme="light"] .session-countdown-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.session-countdown-digits {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 3px;
  line-height: 1;
}

[data-theme="light"] .session-countdown-digits {
  color: #b45309;
}

[data-theme="dark"] .session-countdown-digits {
  color: #fbbf24;
}

.session-countdown-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.5px;
}

.session-warning-actions {
  display: flex;
  gap: 0.75rem;
}

.session-extend-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--text-primary);
  color: var(--canvas);
  border: 1px solid var(--text-primary);
  border-radius: 0px;
  padding: 0.65rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

[data-theme="dark"] .session-extend-btn {
  background: var(--accent-ice);
  color: #0b0c0e;
  border-color: var(--accent-ice);
}

[data-theme="dark"] .session-extend-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

[data-theme="light"] .session-extend-btn {
  background: #09090b;
  color: #ffffff;
  border-color: #09090b;
}

[data-theme="light"] .session-extend-btn:hover {
  background: #27272a;
  border-color: #27272a;
  color: #ffffff;
}

.session-logout-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--hairline-strong);
  border-radius: 0px;
  padding: 0.65rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
}

[data-theme="dark"] .session-logout-now-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

[data-theme="light"] .session-logout-now-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.4);
  color: #b91c1c;
}

/* ── Session Toast Security Notices ────────────────────────── */
.session-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
  pointer-events: none;
}

.session-toast-item {
  pointer-events: auto;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: 0px;
  padding: 0.75rem 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: toastEntrance 0.25s ease forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.session-toast-item.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.session-toast-item.toast-warning {
  border-left: 3px solid var(--warning);
}

.session-toast-item.toast-info {
  border-left: 3px solid var(--accent-ice);
}

.session-toast-item.toast-success {
  border-left: 3px solid var(--success);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info .toast-icon {
  color: var(--accent-ice);
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-message {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.toast-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color var(--speed-fast) ease;
}

.toast-dismiss-btn:hover {
  color: var(--text-primary);
}

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

/* ── Supabase Configuration Modal ─────────────────────────── */
.editorial-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.editorial-modal-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  animation: dropdownFadeIn 0.2s ease forwards;
}

.modal-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-badge {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--accent-ice);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1px;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

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

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

.modal-card-body {
  padding: 1.5rem;
}

.modal-notice-box {
  background: rgba(195, 217, 243, 0.08);
  border: 1px solid var(--accent-ice);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.modal-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--speed-fast) ease;
}

.form-input:focus {
  border-color: var(--accent-ice);
}

.form-hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.modal-card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-cancel-btn {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.modal-save-btn {
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity var(--speed-fast) ease;
}

.modal-save-btn:hover {
  opacity: 0.9;
}

/* ── Hub Tabs Navigation ─────────────────────────────────── */
.hub-tabs-container {
  margin: 1.5rem 0 2rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
}

.hub-tabs-nav {
  display: flex;
  gap: 0.5rem;
}

.hub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
  margin-bottom: -1px;
}

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

.hub-tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
  font-weight: 600;
}

.tab-badge-count {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
}

.hub-tab-btn.active .tab-badge-count {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.hub-tab-content {
  display: none;
  animation: dropdownFadeIn 0.2s ease forwards;
}

.hub-tab-content.active {
  display: block;
}

/* ── My Learning Grid & Cards ─────────────────────────────── */
.my-learning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .my-learning-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .my-learning-grid {
    grid-template-columns: 1fr;
  }
}

.my-learning-card.global-course-card {
  flex: none;
  width: 100%;
}

.my-course-status-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  font-weight: 400;
}

.my-course-status-tag.in-progress {
  background: rgba(195, 217, 243, 0.12);
  color: var(--accent-ice);
  border: 1px solid rgba(195, 217, 243, 0.3);
}

.my-course-status-tag.completed {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.my-course-progress-section {
  margin-bottom: 0.35rem;
}

.my-course-progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.progress-pct-bold {
  color: var(--text-primary);
  font-weight: 400;
}

.progress-count-dim {
  color: var(--text-muted);
}

.my-course-progress-track {
  width: 100%;
  height: 4px;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.my-course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c3d9f3 0%, #ffffff 100%);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* ── My Learning Empty State ──────────────────────────────── */
.my-learning-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  max-width: 540px;
  margin: 1rem auto 3rem;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.empty-state-desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.75rem 0;
}

.btn-explore-courses {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-pill);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--speed-fast) ease;
}

.btn-explore-courses:hover {
  opacity: 0.9;
}

/* ── Reader Top Navbar Right Action Container ─────────────── */
.reader-navbar-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Sidebar Progress Box ─────────────────────────────────── */
.sidebar-progress-box {
  margin-top: 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}

.sidebar-progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

.sidebar-progress-pct {
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-progress-fraction {
  color: var(--text-muted);
}

.sidebar-progress-track {
  width: 100%;
  height: 4px;
  background: var(--surface-card);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: var(--accent-ice);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

/* ── Sidebar Article Nav Status Icons ─────────────────────── */
.article-nav-btn {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.article-nav-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.article-nav-status-icon .svg-icon {
  width: 14px;
  height: 14px;
}

.article-nav-status-icon .status-pending {
  color: var(--hairline-strong);
}

.article-nav-btn.completed .article-nav-status-icon .status-success {
  color: var(--success);
}

.article-nav-btn.completed .article-nav-text {
  opacity: 0.85;
}

/* ── Lesson Completion Card (Bottom of Article) ───────────── */
.lesson-completion-card {
  margin: 3rem 0 2rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .lesson-completion-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-mark-completed {
    width: 100%;
  }
}

.completion-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.completion-card-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-mark-completed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.35rem;
  background: var(--surface-card);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed-fast) ease;
  white-space: nowrap;
}

.btn-mark-completed:hover {
  background: var(--surface-hover);
  border-color: var(--text-primary);
}

.btn-mark-completed.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--success);
  color: var(--success);
}

.btn-mark-completed.completed:hover {
  background: rgba(16, 185, 129, 0.2);
}
