/* ==========================================================================
   ICT & SMC Interactive Mastery Academy — High-Taste Systematic UI/UX
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f1624;
  --bg-card: #131c2e;
  --bg-card-hover: #182338;
  --bg-elevated: #1c2840;
  --bg-glass: rgba(15, 22, 36, 0.90);

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

  --border-color: #1e293b;
  --border-strong: #2d3d59;
  --border-subtle: rgba(255, 255, 255, 0.06);

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  --accent-pink: #ec4899;

  --bull-bg: rgba(16, 185, 129, 0.10);
  --bull-border: rgba(16, 185, 129, 0.30);
  --bear-bg: rgba(239, 68, 68, 0.10);
  --bear-border: rgba(239, 68, 68, 0.30);
  --gold-bg: rgba(245, 158, 11, 0.10);
  --gold-border: rgba(245, 158, 11, 0.30);
  --info-bg: rgba(59, 130, 246, 0.10);
  --info-border: rgba(59, 130, 246, 0.30);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.22);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.65);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-subtle: rgba(15, 23, 42, 0.06);

  --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.05);
  --shadow-modal: 0 20px 50px rgba(15, 23, 42, 0.18);
}

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

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* ==========================================================================
   App Layout (Clean Sidebar + Spacious Main Area)
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.brand-box {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Overall Sidebar Progress Widget */
.sidebar-progress-card {
  margin: 14px 14px 6px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.sp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sp-pct {
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  font-size: 13.5px;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: var(--bg-primary);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-emerald));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.sp-stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.sp-stats-mini span strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Sidebar Navigation */
.nav-section-label {
  padding: 14px 18px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}

.nav-list {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

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

.nav-btn.active {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.30);
}

body.theme-light .nav-btn.active {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}

.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.nav-btn.active .nav-badge {
  background: var(--accent-blue);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* ==========================================================================
   Main Area & Topbar
   ========================================================================== */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
}

.live-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

.pulse-dot.inactive {
  background: var(--accent-amber);
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-container {
  padding: 28px 32px 48px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.18s ease;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   Sub-Tab Navigation Bar (Progressive Disclosure — Keeps UI Uncluttered)
   ========================================================================== */
.subtab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.subtab-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.subtab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  text-decoration: none;
}

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

.btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #60a5fa;
  color: #ffffff;
}

.btn-emerald {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background: #047857;
  color: #ffffff;
}

.btn-amber {
  background: #d97706;
  border-color: #f59e0b;
  color: #ffffff;
}

.btn-amber:hover:not(:disabled) {
  background: #b45309;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-emerald {
  background: var(--bull-bg);
  color: #34d399;
  border-color: var(--bull-border);
}

.badge-rose {
  background: var(--bear-bg);
  color: #f87171;
  border-color: var(--bear-border);
}

.badge-amber {
  background: var(--gold-bg);
  color: #fbbf24;
  border-color: var(--gold-border);
}

.badge-blue {
  background: var(--info-bg);
  color: #60a5fa;
  border-color: var(--info-border);
}

/* ==========================================================================
   Page Headers & Clean Hero Banner
   ========================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 780px;
}

.hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-tile-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-tile-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   6 Module Systematic Cards Grid
   ========================================================================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--shadow-card);
}

.module-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.mc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.mc-step-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.mc-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  margin: 8px 0 6px;
}

.mc-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.mc-outcomes {
  list-style: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.mc-outcomes li {
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mc-outcomes li::before {
  content: "•";
  color: var(--accent-blue);
  font-weight: 800;
}

.mc-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.mc-metric-val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
}

.mc-metric-lbl {
  font-size: 11px;
  color: var(--text-secondary);
}

.mc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   View 2: 137 Articles — Module Tabs, Clean Filter Bar & Systematic Cards
   ========================================================================== */
.module-tabs-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.mod-tab-card {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.mod-tab-card:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mod-tab-card.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.mod-tab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.mod-tab-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 34px 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

.select-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.pill-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--shadow-card);
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.article-card.is-read {
  border-color: rgba(16, 185, 129, 0.45);
}

.art-thumb {
  width: 100%;
  height: 140px;
  background: #f2f2f2;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.art-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-status-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
}

.art-status-chip.done {
  background: #059669;
  color: #fff;
}

.art-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.art-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.art-title-id {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  cursor: pointer;
}

.art-title-id:hover {
  color: var(--accent-blue);
}

.art-title-en {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.art-summary {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Course Outline & LearnHarness Panels
   ========================================================================== */
.phase-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.phase-tab-btn {
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.phase-tab-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.outline-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.outline-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.outline-item-card:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
}

.outline-item-card.completed {
  border-left: 4px solid var(--accent-emerald);
}

.lh-graph-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.lh-nodes-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.lh-node {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.lh-node-stage {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 4px;
}

.lh-node-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.lh-node-stmt {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Modal Deep-Dive Reader (for 137 Articles)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.80);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-svg-banner {
  width: 100%;
  max-height: 200px;
  background: #f2f2f2;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-svg-banner svg {
  width: 100%;
  max-height: 195px;
}

.deep-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.deep-box-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.deep-box.bridge { border-left: 3px solid var(--accent-cyan); }
.deep-box.click { border-left: 3px solid var(--accent-amber); }
.deep-box.spot { border-left: 3px solid var(--accent-blue); }
.deep-box.trade { border-left: 3px solid var(--accent-emerald); }
.deep-box.mistakes { border-left: 3px solid var(--accent-rose); }
.deep-box.drill { border-left: 3px solid var(--accent-purple); }

.deep-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  margin-top: 8px;
  resize: vertical;
}

/* ==========================================================================
   View 3: Buku Kursus PDF (32 Chapters Reader)
   ========================================================================== */
.pdf-reader-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 20px;
  align-items: start;
}

.pdf-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-height: 78vh;
  overflow-y: auto;
  padding: 12px;
}

.pdf-ch-item {
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 3px;
}

.pdf-ch-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.pdf-ch-item.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--text-primary);
  font-weight: 700;
}

.pdf-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.drill-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  margin-top: 8px;
  cursor: pointer;
}

.drill-check-item.checked {
  border-color: var(--accent-emerald);
  background: var(--bull-bg);
}

.drill-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

/* ==========================================================================
   View 4: Official TradingView Lightweight Charts & 4 ICT Tools
   ========================================================================== */
.sim-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.chart-Stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.tv-terminal-shell {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 12px 0;
}

.tv-topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-symbol-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.tv-ohlc-legend {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-ohlc-legend strong {
  color: var(--text-primary);
}

.tv-layer-bar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
}

.tv-layer-toggles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.tv-layer-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 11px;
}

.tv-layer-check input {
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.tv-stage-container {
  position: relative;
  width: 100%;
  height: 430px;
  background: #090d16;
}

#tv-lightweight-mount {
  width: 100%;
  height: 100%;
}

#tv-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

.blind-mode-banner {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.blind-step-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.blind-step-btn.active-target {
  border-color: var(--accent-amber);
  background: var(--gold-bg);
}

.blind-step-btn.done-target {
  border-color: var(--accent-emerald);
  background: var(--bull-bg);
}

.sim-lens-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lens-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.lens-card.retail { border-left: 3px solid var(--accent-rose); }
.lens-card.ict { border-left: 3px solid var(--accent-emerald); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.kz-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
  font-size: 12.5px;
  margin-top: 12px;
}

.kz-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kz-table td {
  padding: 10px 10px;
  border-top: 1px solid transparent;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  transition: all 0.2s ease;
}

.kz-table tbody tr.kz-active-row td {
  background: rgba(16, 185, 129, 0.16);
  border-top: 1.5px solid #10b981;
  border-bottom: 1.5px solid #10b981;
  color: var(--text-primary);
  font-weight: 600;
}

.kz-table tbody tr.kz-active-row td:first-child {
  border-left: 4px solid #10b981;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.kz-table tbody tr.kz-active-row td:last-child {
  border-right: 1.5px solid #10b981;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.kz-table tbody tr.kz-next-row td {
  background: rgba(245, 158, 11, 0.08);
  border-top: 1px dashed rgba(245, 158, 11, 0.45);
  border-bottom: 1px dashed rgba(245, 158, 11, 0.45);
}

.kz-table tbody tr.kz-next-row td:first-child {
  border-left: 3px solid #f59e0b;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.kz-table tbody tr.kz-next-row td:last-child {
  border-right: 1px dashed rgba(245, 158, 11, 0.45);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* ==========================================================================
   View 5: Quiz Engine (100 Soal per Modul, Show 20 Acak + Retest)
   ========================================================================== */
.quiz-session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.q-nav-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.q-dot {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.q-dot.current {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.22);
  color: var(--text-primary);
}

.q-dot.correct {
  background: var(--bull-bg);
  border-color: var(--accent-emerald);
  color: #34d399;
}

.q-dot.wrong {
  background: var(--bear-bg);
  border-color: var(--accent-rose);
  color: #f87171;
}

.q-dot.answered {
  background: var(--info-bg);
  border-color: var(--accent-blue);
  color: #60a5fa;
}

.q-prompt {
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.45;
  margin: 14px 0 18px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
}

.option-btn.selected {
  border-color: var(--accent-blue);
  background: var(--info-bg);
}

.option-btn.correct {
  border-color: var(--accent-emerald);
  background: var(--bull-bg);
}

.option-btn.wrong {
  border-color: var(--accent-rose);
  background: var(--bear-bg);
}

.opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12.5px;
  flex-shrink: 0;
}

.confidence-bar {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.conf-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.conf-btn.active {
  border-color: var(--accent-amber);
  background: var(--gold-bg);
  color: #fbbf24;
}

.q-exp-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-emerald);
}

/* ==========================================================================
   View 6: Glossary & Master Link Audit
   ========================================================================== */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.glossary-card.mastered {
  border-color: rgba(16, 185, 129, 0.5);
}

.audit-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-table th,
.audit-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.audit-table th {
  background: var(--bg-secondary);
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ==========================================================================
   Sequential Progression Lock & Admin Panel Styles
   ========================================================================== */
.seq-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.next-module-gate-card {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 60%), var(--bg-card);
  border: 1.5px dashed rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.module-card.is-locked {
  opacity: 0.68;
  border-style: dashed;
}

.mod-tab-card.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.req-pill-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
}

.req-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 12.5px;
}

.req-pill-item.met,
.req-pill-item.done {
  border-color: var(--bull-border);
  background: var(--bull-bg);
}

/* ==========================================================================
   8 ICT Trading Tools Suite — Command Dock, SVG Diagrams & 24H Timeline
   ========================================================================== */
.ict-tools-dock {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.ict-tool-dock-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.16s ease;
  color: var(--text-primary);
}

.ict-tool-dock-btn:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.ict-tool-dock-btn.active {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.11);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 8px 20px rgba(16, 185, 129, 0.12);
}

.dock-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-muted);
}

.ict-tool-dock-btn.active .dock-top-row {
  color: var(--accent-emerald);
}

.dock-title {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 7px;
}

.dock-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.pro-tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.pro-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.pro-tool-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  align-items: start;
}

.svg-schematic-box {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow: hidden;
}

body.theme-light .svg-schematic-box {
  background: #f8fafc;
}

.level-row-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.level-row-item.emph-emerald {
  background: rgba(16, 185, 129, 0.14);
  border: 1.5px solid rgba(16, 185, 129, 0.55);
}

.level-row-item.emph-amber {
  background: rgba(245, 158, 11, 0.13);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
}

.level-row-item.emph-rose {
  background: rgba(244, 63, 94, 0.12);
  border: 1.5px solid rgba(244, 63, 94, 0.5);
}

.level-row-item.emph-blue {
  background: rgba(59, 130, 246, 0.12);
  border: 1.5px solid rgba(59, 130, 246, 0.5);
}

.fxh-timeline-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow-x: auto;
}

.fxh-track-row {
  display: grid;
  grid-template-columns: 195px 1fr 145px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.fxh-track-row.is-live-now {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: inset 0 0 14px rgba(16, 185, 129, 0.12);
}

.fxh-bar-lane {
  position: relative;
  height: 22px;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.fxh-bar-segment {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  opacity: 0.85;
}

.fxh-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  z-index: 4;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.admin-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-setting-row:last-child {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  transition: 0.2s;
  border-radius: 999px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background-color: var(--accent-emerald);
}

/* ==========================================================================
   Right-Side Institutional Clean Panel (HUD) & Clean-Chart Layer Controller
   ========================================================================== */
.hud-guidance-card {
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

body.theme-light .hud-guidance-card {
  background: #0f172a;
  color: #f8fafc;
}

.hud-guidance-header {
  background: #070a12;
  padding: 10px 14px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-guidance-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud-guidance-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
}

.hud-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.hud-summary-table td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  vertical-align: middle;
}

.hud-summary-table tr:nth-child(odd) td {
  background: rgba(15, 23, 42, 0.85);
}

.hud-summary-table tr:nth-child(even) td {
  background: rgba(17, 24, 39, 0.85);
}

.hud-summary-table tr:last-child td {
  border-bottom: none;
}

.hud-lbl-col {
  color: #94a3b8;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.hud-summary-table tr.hud-status-row.state-long td {
  background: rgba(6, 78, 59, 0.55);
}

.hud-summary-table tr.hud-status-row.state-short td {
  background: rgba(127, 29, 29, 0.55);
}

.hud-summary-table tr.hud-status-row.state-ready td {
  background: rgba(69, 26, 3, 0.55);
}

.hud-summary-table tr.hud-status-row.state-wait td {
  background: rgba(30, 41, 59, 0.65);
}

.hud-summary-table tr.hud-section-divider td {
  background: #070a12;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
}

.hud-val-mono {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.swing-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.swing-preset-pill {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.swing-preset-pill:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.swing-preset-pill.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent-blue);
  color: #60a5fa;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.hud-pill.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.hud-pill.warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.hud-pill.bad {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.hud-pill.wait {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

body.theme-light .hud-pill.ok {
  color: #047857;
}
body.theme-light .hud-pill.warn {
  color: #b45309;
}
body.theme-light .hud-pill.bad {
  color: #b91c1c;
}

/* Clean Chart Preset & Area Hide Toolbar */
.clean-chart-presets-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.clean-preset-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clean-preset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.clean-preset-btn.active {
  background: var(--info-bg);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Pine Script Studio Layout */
.pine-studio-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 18px;
  align-items: start;
}

.pine-code-box {
  background: #070b12;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 540px;
  overflow: auto;
  white-space: pre;
  tab-size: 4;
}

.pine-layer-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pine-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.pine-layer-item:hover {
  border-color: var(--accent-blue);
}

/* ==========================================================================
   Taste-Skill & UI/UX Pro Max: Mastery Command Deck, Admin KPI & Toast UI
   ========================================================================== */
.ux-mastery-deck {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 22px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(19, 28, 46, 0.94) 0%, rgba(12, 18, 30, 0.98) 100%);
  box-shadow: var(--shadow-card);
}

body.theme-light .ux-mastery-deck {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-color: rgba(37, 99, 235, 0.3);
}

.ux-mastery-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

.ux-radial-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ux-radial-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.ux-mastery-info {
  flex: 1;
}

.ux-mastery-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.ux-mastery-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.ux-mastery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ux-admin-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.ux-admin-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: var(--shadow-card);
}

.ux-admin-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
}

.ux-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ux-kpi-val {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.ux-kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.ux-user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(59, 130, 246, 0.4);
}

.ux-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.ux-user-avatar.is-admin {
  background: linear-gradient(135deg, #f59e0b, #10b981);
}

.ux-quick-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.ux-quick-user-row.active {
  border-color: rgba(16, 185, 129, 0.5);
  background: var(--bull-bg);
}

/* Glassmorphic Toast Notifications */
.ict-toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 390px;
  pointer-events: none;
}

.ict-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  color: #f1f5f9;
  animation: ictToastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

body.theme-light .ict-toast {
  background: rgba(255, 255, 255, 0.97);
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.ict-toast-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.ict-toast-emerald { border-left: 4px solid var(--accent-emerald); }
.ict-toast-blue { border-left: 4px solid var(--accent-blue); }
.ict-toast-amber { border-left: 4px solid var(--accent-amber); }
.ict-toast-rose { border-left: 4px solid var(--accent-rose); }

.ict-toast-icon {
  margin-top: 2px;
  color: var(--accent-emerald);
}
.ict-toast-blue .ict-toast-icon { color: var(--accent-blue); }
.ict-toast-amber .ict-toast-icon { color: var(--accent-amber); }
.ict-toast-rose .ict-toast-icon { color: var(--accent-rose); }

.ict-toast-body {
  flex: 1;
}

.ict-toast-title {
  font-size: 13.5px;
  font-weight: 800;
}

.ict-toast-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}

.ict-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

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

/* ==========================================================================
   Mobile & Tablet Reading Ergonomics (Font Scale, Drawer Backdrop, Bottom Nav)
   ========================================================================== */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.68);
  backdrop-filter: blur(4px);
  z-index: 38;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mobile-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar-close {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.reader-font-controls {
  display: inline-flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.reader-font-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reader-font-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

/* Dynamic Reading Typography Scales for Articles & PDF Chapters */
body.reader-scale-sm #modal-body-content,
body.reader-scale-sm #pdf-chapter-viewer {
  font-size: 13.8px;
  line-height: 1.65;
}

body.reader-scale-md #modal-body-content,
body.reader-scale-md #pdf-chapter-viewer {
  font-size: 15.2px;
  line-height: 1.74;
}

body.reader-scale-lg #modal-body-content,
body.reader-scale-lg #pdf-chapter-viewer {
  font-size: 17px;
  line-height: 1.82;
}

body.reader-scale-lg #modal-body-content p,
body.reader-scale-lg #modal-body-content li,
body.reader-scale-lg #pdf-chapter-viewer p,
body.reader-scale-lg #pdf-chapter-viewer li {
  font-size: 16.8px !important;
  line-height: 1.82 !important;
}

.pdf-mobile-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Sticky Thumb-Friendly Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 36;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.mbn-item {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.15s ease, background 0.15s ease;
}

.mbn-item.active {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
}

.mbn-icon {
  font-size: 16px;
  line-height: 1.1;
}

.mbn-label {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   Responsive Breakpoints (Tablet <= 1080px & Mobile HP <= 768px / 480px)
   ========================================================================== */
@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -290px;
    width: 278px;
    max-width: 84vw;
    height: 100dvh;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.55);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .mobile-menu-btn,
  .mobile-sidebar-close {
    display: inline-flex;
  }
  .mobile-bottom-nav {
    display: grid;
  }
  .view-container {
    padding: 20px 20px 92px;
  }
  .hero-grid,
  .sim-layout,
  .pdf-reader-layout,
  .admin-grid,
  .pro-tool-split,
  .pine-studio-grid {
    grid-template-columns: 1fr;
  }
  /* Make PDF sidebar compact on tablet/mobile so chapter text is immediately reachable */
  .pdf-sidebar {
    max-height: 220px;
  }
  .ux-admin-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .fxh-track-row {
    grid-template-columns: 140px 1fr 110px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
    gap: 10px;
  }
  .topbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .live-session-pill {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    padding: 5px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .topbar-right::-webkit-scrollbar {
    display: none;
  }
  .topbar-right > * {
    flex-shrink: 0;
  }

  /* Horizontal momentum scroll for tab strips on mobile */
  .subtab-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }
  .subtab-bar::-webkit-scrollbar {
    display: none;
  }
  .subtab-btn {
    flex-shrink: 0;
    font-size: 12.5px;
    padding: 8px 13px;
  }

  .module-tabs-strip {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 4px;
  }
  .module-tabs-strip .mod-tab-card {
    min-width: 215px;
    flex-shrink: 0;
  }

  .ict-tools-dock {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 4px;
  }
  .ict-tools-dock .dock-tool-btn {
    min-width: 175px;
    flex-shrink: 0;
  }

  /* Comfortable Reading Modal (Bottom Sheet Style on Mobile) */
  .modal-backdrop {
    padding: 8px 6px 0;
    align-items: flex-end;
  }
  .modal-dialog {
    max-height: 93dvh;
    border-radius: 18px 18px 0 0;
  }
  .modal-header {
    padding: 12px 15px;
  }
  .modal-body {
    padding: 16px 15px 24px;
  }
  .modal-footer {
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .deep-box {
    padding: 14px 14px;
  }

  /* Compact TradingView Chart Stage on Mobile */
  #tv-lightweight-mount {
    height: 330px !important;
  }
  .tv-stage-container {
    min-height: 330px;
  }

  /* Mastery Deck & Hero Banner on Mobile */
  .hero-banner {
    padding: 18px 16px;
  }
  .hero-title {
    font-size: 21px;
  }
  .ux-mastery-deck {
    padding: 14px 15px;
    gap: 14px;
  }
  .ux-mastery-left {
    flex-direction: column;
    align-items: flex-start;
    min-width: 100%;
    gap: 12px;
  }
  .ux-mastery-actions {
    width: 100%;
  }
  .ux-mastery-actions .btn {
    flex: 1;
    min-width: 140px;
  }

  /* Toast Notification positioning above mobile bottom nav */
  .ict-toast-container {
    left: 12px;
    right: 12px;
    bottom: 74px;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .view-container {
    padding: 14px 12px 92px;
  }
  .modules-grid,
  .articles-grid,
  .tools-grid,
  .glossary-grid,
  .ux-admin-kpi-strip {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 19px;
  }
  .pdf-content-card,
  .admin-card,
  .tool-card,
  .quiz-session-card {
    padding: 16px 14px;
  }
  /* Hide bulky desktop PDF chapter list on small phones because pdf-mobile-toolbar dropdown is right at the top */
  .pdf-sidebar {
    max-height: 175px;
  }
  .fxh-track-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
