/* ==========================================================================
   PRICE ACTION ACADEMY - INSTITUTIONAL TERMINAL STYLESHEET
   Dark Mode Financial Theme (#0b0f19, #111827, Emerald #10b981, Rose #f43f5e, Gold #f59e0b)
   ========================================================================== */

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --bg-elevated: #1a2234;
  
  --border-subtle: #1e293b;
  --border-focus: #334155;
  --border-gold: rgba(245, 158, 11, 0.3);
  --border-emerald: rgba(16, 185, 129, 0.3);
  --border-rose: rgba(244, 63, 94, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.15);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.15);
  --blue: #38bdf8;
  --purple: #a855f7;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.2);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.2);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 70px; /* Space for mobile nav */
}

/* Glassmorphism helpers */
.glass {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   HEADER & TOP TICKER
   ========================================================================== */
.terminal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-gold);
}

.brand-title-group h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-title-group h1 span {
  color: var(--gold);
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Market Ticker Bar */
.ticker-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.ticker-symbol {
  font-weight: 700;
  color: var(--gold);
}

.ticker-price {
  font-weight: 600;
}

.ticker-change {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--rose);
}

.ticker-change.pos {
  color: var(--emerald);
}

.market-status-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* ==========================================================================
   NAVIGATION BAR / MODULE SELECTOR
   ========================================================================== */
.module-nav-container {
  max-width: 1400px;
  margin: 0.75rem auto;
  padding: 0 1.25rem;
}

.module-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  scrollbar-width: none;
}

.module-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-tab.active .tab-icon {
  color: var(--gold);
}

.tab-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  font-family: var(--font-mono);
}

/* ==========================================================================
   MAIN CONTENT CONTAINER & MODULE WRAPPERS
   ========================================================================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.module-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.module-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* General Card Layout */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* ==========================================================================
   MODULE 1: THE EXNESS SCREENSHOT DECONSTRUCTED
   ========================================================================== */
.case-study-hero {
  border-left: 4px solid var(--rose);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.case-study-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose);
  border: 1px solid var(--border-rose);
}

.chart-stage-container {
  position: relative;
  width: 100%;
  height: 480px;
  background: #090d16;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.chart-overlay-tools {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.chart-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.chart-tool-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.chart-tool-btn.active {
  background: var(--bg-card);
  color: var(--gold);
  border-color: var(--border-gold);
}

/* Exness Mobile View Replica Card */
.exness-ui-mockup {
  background: #0d121f;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
}

.exness-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
}

.sentiment-bar-wrapper {
  margin: 1rem 0;
}

.sentiment-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  margin-bottom: 0.35rem;
}

.sentiment-progress {
  height: 8px;
  background: #22c55e;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

.sentiment-buy-fill {
  background: #22c55e;
  height: 100%;
}

.sentiment-sell-fill {
  background: #ef4444;
  height: 100%;
}

.forensic-trap-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.trap-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.trap-item:hover {
  border-color: var(--border-rose);
  background: rgba(244, 63, 94, 0.04);
}

.trap-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.trap-content h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.trap-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   MODULE 2: INTERACTIVE CANDLESTICK REPLAY & SWEEP INSPECTOR
   ========================================================================== */
.replay-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.replay-btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ctrl-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.ctrl-btn.btn-play {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.ctrl-btn.btn-play:hover {
  background: #fbb024;
}

.scenario-toggle-group {
  display: flex;
  background: var(--bg-primary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.scenario-pill {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scenario-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.scenario-pill.pill-sweep.active {
  color: var(--emerald);
  border: 1px solid var(--border-emerald);
}

.scenario-pill.pill-bos.active {
  color: var(--rose);
  border: 1px solid var(--border-rose);
}

.inspector-card {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.step-tracker-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  position: relative;
}

.step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: 2;
  transition: all 0.2s ease;
}

.step-bubble.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--bg-elevated);
  box-shadow: 0 0 12px var(--gold-glow);
}

.step-bubble.completed {
  border-color: var(--emerald);
  background: var(--emerald);
  color: #000;
}

/* ==========================================================================
   MODULE 3: SWEEP-AND-RECLAIM DECISION SIMULATOR
   ========================================================================== */
.sim-container {
  max-width: 840px;
  margin: 0 auto;
}

.sim-progress-bar {
  height: 6px;
  background: var(--bg-card-hover);
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.sim-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--emerald));
  transition: width 0.3s ease;
}

.sim-question-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.sim-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}

.sim-tag.stage {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.sim-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.sim-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateX(4px);
}

.sim-option-btn.correct {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--emerald);
  color: #34d399;
}

.sim-option-btn.wrong {
  background: rgba(244, 63, 94, 0.12);
  border-color: var(--rose);
  color: #fb7185;
}

.sim-feedback-box {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
  animation: fadeIn 0.2s ease;
}

.sim-feedback-box.correct {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--emerald);
  color: #a7f3d0;
}

.sim-feedback-box.wrong {
  display: block;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid var(--rose);
  color: #fecdd3;
}

/* ==========================================================================
   MODULE 4: PRECISION POSITION SIZING & SL BUFFER CALCULATOR
   ========================================================================== */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .calc-container {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-label-tip {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.preset-chip-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 0.2rem 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.results-display-card {
  background: #090e1c;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.primary-metric-highlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.primary-metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.primary-metric-value {
  font-size: 2.25rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
  margin: 0.2rem 0;
}

.primary-metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem;
  border-radius: var(--radius-md);
}

.metric-box-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.metric-box-val {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.metric-box-val.green {
  color: var(--emerald);
}

.metric-box-val.rose {
  color: var(--rose);
}

.rr-ladder-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.rr-ladder-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   MODULE 5: CAMARILLA & CLASSICAL PIVOT ENGINE
   ========================================================================== */
.ladder-visual-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #090d16;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.ladder-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  position: relative;
  transition: all 0.2s ease;
}

.tier-breakout-bull {
  background: rgba(16, 185, 129, 0.15);
  border-left: 4px solid var(--emerald);
  color: #34d399;
}

.tier-sell-zone {
  background: rgba(244, 63, 94, 0.15);
  border-left: 4px solid var(--rose);
  color: #fb7185;
}

.tier-pivot-mean {
  background: rgba(245, 158, 11, 0.12);
  border-left: 4px solid var(--gold);
  color: #fbbf24;
}

.tier-buy-zone {
  background: rgba(16, 185, 129, 0.12);
  border-left: 4px solid var(--emerald);
  color: #34d399;
}

.tier-breakdown-bear {
  background: rgba(244, 63, 94, 0.25);
  border-left: 4px solid var(--rose);
  color: #f43f5e;
}

.tier-label-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   MODULE 6: MASTERCLASS CURRICULUM READER
   ========================================================================== */
.reader-wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .reader-wrapper {
    grid-template-columns: 1fr;
  }
}

.toc-sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.toc-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.toc-link:hover, .toc-link.active {
  color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
}

.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  line-height: 1.7;
}

.article-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #cbd5e1;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-callout {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid var(--gold);
  background: rgba(245, 158, 11, 0.08);
}

.article-callout.important {
  border-left-color: var(--rose);
  background: rgba(244, 63, 94, 0.08);
}

.article-callout.tip {
  border-left-color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
}

pre {
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   BUTTONS & COMMON UI ATOMS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #000;
}

.btn-primary:hover {
  background: #fbb024;
  box-shadow: var(--shadow-glow-gold);
}

.btn-emerald {
  background: var(--emerald);
  color: #000;
}

.btn-emerald:hover {
  background: #34d399;
  box-shadow: var(--shadow-glow-emerald);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  .module-nav-container {
    display: none;
  }
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: all 0.15s ease;
}

.mob-nav-item.active {
  color: var(--gold);
}


/* ==========================================================================
   MOBILE-FIRST OVERHAUL PATCH (360px - 480px Touchscreens)
   ========================================================================== */

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

.container {
  padding: 0.75rem 0.65rem !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* X-Ray Cards Grid */
.xray-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

@media (min-width: 640px) {
  .xray-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.xray-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid #f43f5e;
}

.xray-card.trap-frontrun { border-left-color: #f59e0b; }
.xray-card.trap-displacement { border-left-color: #f43f5e; }
.xray-card.trap-sentiment { border-left-color: #38bdf8; }
.xray-card.trap-reclaim { border-left-color: #a855f7; }

.xray-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.35rem;
}

.xray-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.25rem;
}

.xray-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* Mobile Toolbar Wrap */
@media (max-width: 640px) {
  .chart-controls-toolbar, .forensic-toolbar, .chart-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }
  
  .chart-controls-toolbar .btn, 
  .forensic-toolbar .btn, 
  .chart-controls .btn {
    flex: 1 1 calc(50% - 0.4rem) !important;
    min-width: 120px !important;
    font-size: 0.72rem !important;
    padding: 0.45rem 0.5rem !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  
  .app-header {
    padding: 0.6rem 0.75rem !important;
  }
  
  .hero-card, .case-study-hero {
    padding: 1rem 0.85rem !important;
  }
  
  .hero-title {
    font-size: 1.15rem !important;
  }
  
  /* Single column grids on mobile */
  .grid-3, .grid-2, .forensic-grid, .calc-container, .ladder-container, .reader-wrapper {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  
  /* Touch Input Sizing (prevents iOS auto-zoom) */
  input, select, textarea {
    font-size: 16px !important;
  }
}
