/* ─────────────────────────────────────────────────────────────────────
   PREEV-INSPIRED MINIMAL DESIGN
   White space. Gray text. Numbers float. No decoration.
   ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --text: #333333;
  --text-soft: #666666;
  --text-faded: #999999;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --accent: #f7931a;
  --green: #4a7c5d;
  --red: #b85450;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --transition: background 0.2s, color 0.2s, border-color 0.2s;
  --page-w: 1100px; /* shared max width for all tabbed content pages */
}

/* Dark mode — activated by body.theme-dark */
body.theme-dark {
  --bg: #1a1a1a;
  --bg-soft: #242424;
  --text: #ededed;       /* §1.3 — slightly brighter than #e8e8e8 */
  --text-soft: #b8b8b8;
  --text-faded: #8a8a8a;
  --border: #3a3a3a;
  --border-light: #2e2e2e;
  --green: #5fa874;
  --red: #d9685e;
}

/* §2 — Sepia: warm, easy on eyes for long reading sessions */
body.theme-sepia {
  --bg: #f4ecd8;
  --bg-soft: #ebe2c8;
  --text: #3d2817;
  --text-soft: #6b4e2e;
  --text-faded: #8b7355;
  --border: #d4c5a0;
  --border-light: #e2d6b8;
  --green: #5c7c4e;
  --red: #a64d3f;
}

/* §2 — High Contrast: pure black/white, accessibility */
body.theme-contrast {
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --text: #000000;
  --text-soft: #1a1a1a;
  --text-faded: #4a4a4a;
  --border: #000000;
  --border-light: #888888;
  --green: #0a5c2c;
  --red: #8a0a0a;
}
body.theme-sepia .ind-card,
body.theme-sepia .stat-box,
body.theme-sepia .mtf-cell,
body.theme-sepia .section-card,
body.theme-sepia #modal,
body.theme-contrast .ind-card,
body.theme-contrast .stat-box,
body.theme-contrast .mtf-cell,
body.theme-contrast .section-card,
body.theme-contrast #modal {
  background: var(--bg-soft);
}
body.theme-dark .conv-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23888' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
}
body.theme-dark .warn-box { background: #2a2419; color: #d4b878; }
body.theme-dark .good-box { background: #1f2820; color: #8ac99c; }
body.theme-dark #modal-backdrop { background: rgba(0,0,0,0.6); }
body.theme-dark .ind-card,
body.theme-dark .stat-box,
body.theme-dark .mtf-cell,
body.theme-dark .academy-quiz,
body.theme-dark .quiz-option,
body.theme-dark .trade-card,
body.theme-dark .section-card,
body.theme-dark .lesson-nav button,
body.theme-dark #academy-progress,
body.theme-dark #modal,
body.theme-dark #academy-content .academy-svg,
body.theme-dark #academy-content .academy-callout,
body.theme-dark #academy-content .academy-formula {
  background: var(--bg-soft);
}
body.theme-dark .quiz-option.correct { background: #1f3a27; border-color: var(--green); color: var(--green); }
body.theme-dark .quiz-option.wrong { background: #3a1f1f; border-color: var(--red); color: var(--red); }
body.theme-dark .academy-lesson-link.active { background: #2a2218; }
/* §1.3 — canvas brightness hack removed; chart colors now theme-aware via getChartColors() */

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

a { color: inherit; }

/* ─── Top bar (logo + tabs + beginner/pro toggle) ─── */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

#logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
#logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 700;
  border-radius: 3px;
}

#tabs {
  display: flex;
  gap: 0;
}
.tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  position: relative;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 500; }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--accent);
}

/* Beginner / Pro toggle */
#topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
#mode-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
}
/* §2 — Theme picker (replaces old binary toggle) */
#theme-picker { position: relative; }
#theme-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
#theme-picker-btn:hover { color: var(--accent); border-color: var(--accent); }
#theme-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
}
#theme-picker-menu.hidden { display: none; }
.theme-option {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text-soft);
  font-family: var(--sans);
}
.theme-option:hover { background: var(--bg-soft); color: var(--text); }
.theme-option.active { color: var(--accent); font-weight: 500; }
.theme-option.active::after { content: ' ✓'; color: var(--accent); }
body.theme-dark #theme-picker-menu { box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.mode-opt {
  padding: 5px 12px;
  cursor: pointer;
  color: var(--text-faded);
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.mode-opt.active {
  background: var(--accent);
  color: white;
}

/* Hide mode toggle in beginner default — show "?" instead */
@media (max-width: 600px) {
  #topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  #tabs { order: 3; width: 100%; justify-content: center; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
  .tab.active::after { bottom: -10px; }
  #logo { font-size: 12px; }
}

/* ─── Page containers ─── */
.page { display: none; }
.page.active { display: block; }

/* ─── CONVERTER PAGE (pure Preev style) ─── */
/* `display: flex` must apply only when the page is active — otherwise the
   id-selector beats .page { display: none } and converter shows on every
   tab. The flex layout itself is the §1.1 fix (footer auto-margin). */
#converter-page.active {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px;
}
#converter-page { padding: 0 24px; }

.preev-headline {
  margin-top: 80px;
  font-size: 18px;
  color: var(--text-soft);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
}
.preev-headline b { color: var(--accent); font-weight: 500; }

@media (max-width: 600px) {
  .preev-headline { margin-top: 40px; font-size: 15px; }
}

/* Conversion rows */
#conv-rows {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 520px;
}

.conv-row {
  display: grid;
  grid-template-columns: 1fr 110px 24px;
  gap: 8px;
  align-items: center;
  font-size: 26px;
  font-weight: 300;
}

@media (max-width: 600px) {
  .conv-row {
    grid-template-columns: 1fr 100px 24px;
    gap: 6px;
    font-size: 22px;
  }
}

.conv-input, .conv-output {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 14px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: inherit;
  color: var(--text);
  outline: none;
  text-align: right;
  width: 100%;
  border-radius: 2px;
  min-width: 0;
}
.conv-input:focus { border-color: var(--accent); }

.conv-select {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 8px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  color: var(--text-soft);
  outline: none;
  text-align: center;
  cursor: pointer;
  border-radius: 2px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23999' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}
.conv-select:hover { border-color: var(--text-soft); }
.conv-select:focus { border-color: var(--accent); }

.conv-remove-btn {
  background: none;
  border: none;
  color: var(--text-faded);
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: var(--sans);
  transition: color 0.1s;
}
.conv-remove-btn:hover { color: var(--red); }

.conv-add-row, .conv-remove-row {
  font-size: 11px;
  color: var(--text-faded);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  margin-top: 16px;
  letter-spacing: 0.04em;
}
.conv-add-row:hover, .conv-remove-row:hover { color: var(--accent); }

/* §1.1 — push footer to absolute bottom of converter page; column-flex w/ auto-margin
   §1.2 — bigger price-status text for mobile readability */
#conv-footer {
  margin-top: auto;
  padding: 24px 20px 28px;
  text-align: center;
  color: var(--text-faded);
  line-height: 1.7;
  width: 100%;
}
#conv-footer .disclaimer-tagline {
  font-size: 12px;
  margin-bottom: 6px;
}
#conv-footer .price-status,
#price-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ─── ANALYSIS PAGE (chart on top, grid of tools below) ─── */
#analysis-page {
  padding: 30px 24px 60px;
  max-width: var(--page-w);
  margin: 0 auto;
}

@media (max-width: 600px) {
  #analysis-page { padding: 20px 14px 40px; }
}

/* §D1 — Network page shares the same boxed width as the other content pages. */
#network-page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 30px 24px 60px;
}
@media (max-width: 600px) {
  #network-page { padding: 20px 14px 40px; }
}

.section-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 24px;
  margin-bottom: 18px;
}

.section-card h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}
.section-card .section-sub {
  font-size: 12px;
  color: var(--text-faded);
  margin-bottom: 16px;
  line-height: 1.6;
}

.section-card .beginner-explanation {
  background: var(--bg-soft);
  border-left: 2px solid var(--text-faded);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}
body.mode-pro .beginner-explanation { display: none; }

.section-card .pro-explanation { display: none; }
body.mode-pro .pro-explanation {
  display: block;
  background: var(--bg-soft);
  border-left: 2px solid var(--text-faded);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.7;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
}

@media (max-width: 600px) {
  .section-card { padding: 16px; }
}

/* Timeframe selector */
#timeframe-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tf-btn {
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-faded);
  border-radius: 2px;
  font-family: var(--sans);
}
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Chart container */
#chart-wrap canvas { width: 100%; display: block; }
#chart-canvas { height: 360px; }
#rsi-canvas { height: 80px; margin-top: 8px; }
#macd-canvas { height: 80px; margin-top: 8px; }

.chart-caption {
  font-size: 10px;
  color: var(--text-faded);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

#chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-faded);
  margin-bottom: 8px;
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 14px; height: 2px; }

/* Verdict box */
#verdict-card {
  text-align: center;
  padding: 20px;
}
#verdict-text {
  /* §D3 — one step smaller + ~20% less saturation so the headline reads as a
     calm description, not a signal. (dkbit98's feedback.) */
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 8px 0;
  filter: saturate(0.8);
}
#verdict-detail {
  font-size: 12px;
  color: var(--text-faded);
}
#verdict-reasoning {
  margin-top: 14px;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
#verdict-reasoning ul { margin: 8px 0 0 20px; }
#verdict-reasoning li { margin-bottom: 6px; }

/* Indicators grid */
#indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.ind-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 14px;
}
.ind-card h3 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 0.04em;
}
.ind-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border-light);
}
.ind-row:last-child { border: none; }
.ind-row .label { color: var(--text-faded); }
.ind-row .value { font-weight: 500; color: var(--text); }
.signal-bull { color: var(--green) !important; }
.signal-bear { color: var(--red) !important; }
.signal-neutral { color: var(--text-faded) !important; }

/* Tools grid (multi-timeframe, backtester, paper trading, risk, sentiment) */
#tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  #tools-grid { grid-template-columns: 1fr; }
}

/* Multi-timeframe inside its card */
.mtf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.mtf-cell {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  padding: 12px;
  border-radius: 3px;
}
.mtf-tf { font-size: 10px; color: var(--text-faded); letter-spacing: 0.04em; margin-bottom: 8px; }
.mtf-bias { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.mtf-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 0;
}
.mtf-row .ml { color: var(--text-faded); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 12px;
}
@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-faded);
  letter-spacing: 0.02em;
}
.form-grid input, .form-grid select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  color: var(--text);
  font-family: var(--sans);
  border-radius: 2px;
  outline: none;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--accent); }

.btn {
  padding: 9px 18px;
  background: var(--accent);
  color: white;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.02em;
}
.btn:hover { background: #e07e0a; }
.btn.outline { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn.outline:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--bg); color: var(--red); border: 1px solid var(--red); }
.btn.danger:hover { background: var(--red); color: white; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.stat-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  padding: 10px;
  border-radius: 2px;
}
.stat-label { font-size: 10px; color: var(--text-faded); letter-spacing: 0.02em; margin-bottom: 4px; }
.stat-value { font-size: 16px; font-weight: 500; color: var(--text); }
.stat-sub { font-size: 10px; color: var(--text-faded); margin-top: 2px; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { font-size: 10px; font-weight: 500; color: var(--text-faded); letter-spacing: 0.02em; text-transform: uppercase; }
td.num { text-align: right; }
tr.profit td.pnl { color: var(--green); }
tr.loss td.pnl { color: var(--red); }

/* Trade card */
.trade-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 2px;
  margin-bottom: 8px;
  font-size: 12px;
}
.trade-side {
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: white;
  border-radius: 2px;
}
.trade-side.long { background: var(--green); }
.trade-side.short { background: var(--red); }
.trade-pnl.profit { color: var(--green); font-weight: 500; }
.trade-pnl.loss { color: var(--red); font-weight: 500; }

.warn-box {
  padding: 10px 12px;
  background: #fff8ed;
  border-left: 2px solid var(--accent);
  font-size: 11px;
  color: #6b5d1a;
  margin-top: 8px;
  line-height: 1.5;
  border-radius: 0 2px 2px 0;
}
.good-box {
  padding: 10px 12px;
  background: #f1f9f3;
  border-left: 2px solid var(--green);
  font-size: 11px;
  color: #2d5040;
  margin-top: 8px;
  line-height: 1.5;
  border-radius: 0 2px 2px 0;
}

/* Sentiment gauge */
#sentiment-canvas { width: 100%; max-width: 280px; height: 170px; display: block; margin: 0 auto; }
#fng-details { text-align: center; font-size: 11px; color: var(--text-faded); margin-top: 8px; }

/* ─── ACADEMY PAGE ─── */
#academy-page { max-width: var(--page-w); margin: 0 auto; padding: 30px 24px 60px; }

#academy-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
@media (max-width: 720px) { #academy-layout { grid-template-columns: 1fr; } }

#academy-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: start;
  padding-right: 8px;
}
@media (max-width: 720px) {
  #academy-sidebar { position: static; max-height: none; }
}

#academy-progress {
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  font-size: 10px;
  color: var(--text-faded);
  margin-bottom: 16px;
  border-radius: 2px;
}
#academy-progress .progress-bar { height: 3px; background: var(--border); margin-top: 6px; border-radius: 2px; overflow: hidden; }
#academy-progress .progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }

.academy-chapter-title {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-faded);
  margin: 14px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
}
.academy-chapter-title:first-child { margin-top: 0; }
.academy-lesson-link {
  display: block;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.1s;
}
.academy-lesson-link:hover { color: var(--text); }
.academy-lesson-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--bg-soft); font-weight: 500; }
.academy-lesson-link .lesson-num { color: var(--text-faded); font-size: 10px; margin-right: 6px; }
.academy-lesson-link.completed::after { content: '✓'; float: right; color: var(--green); }

#academy-content { min-width: 0; }
#academy-content h2 { font-size: 24px; font-weight: 500; margin-bottom: 4px; }
#academy-content .academy-meta-bar { font-size: 11px; color: var(--text-faded); margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); letter-spacing: 0.02em; }
#academy-content p { font-size: 14px; line-height: 1.75; color: var(--text); margin-bottom: 12px; }
#academy-content h5 { font-size: 14px; font-weight: 500; margin: 22px 0 8px; }
#academy-content h6 { font-size: 13px; font-weight: 500; margin: 16px 0 6px; }
#academy-content b { color: var(--text); font-weight: 600; }
#academy-content .academy-list { margin: 6px 0 12px 20px; }
#academy-content .academy-list li { font-size: 14px; line-height: 1.7; margin-bottom: 4px; }
#academy-content .academy-svg { width: 100%; height: auto; display: block; margin: 14px 0; border: 1px solid var(--border-light); background: var(--bg-soft); border-radius: 2px; }
#academy-content .academy-callout { background: var(--bg-soft); border-left: 2px solid var(--accent); padding: 12px 14px; margin: 16px 0; font-size: 13px; line-height: 1.7; color: var(--text-soft); border-radius: 0 2px 2px 0; }
#academy-content .academy-callout b { color: var(--text); }
#academy-content .academy-formula { background: var(--bg-soft); padding: 10px 12px; font-family: 'SF Mono', Consolas, Monaco, monospace; font-size: 12px; margin: 8px 0; border-radius: 2px; }

.academy-quiz { background: var(--bg-soft); border: 1px solid var(--border-light); padding: 18px; margin: 26px 0 14px; border-radius: 3px; }
.academy-quiz h4 { font-size: 11px; color: var(--text-faded); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); letter-spacing: 0.04em; text-transform: uppercase; }
.quiz-question { margin-bottom: 16px; }
.quiz-question .q-text { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-option {
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; cursor: pointer; text-align: left; border-radius: 2px;
  font-family: var(--sans); color: var(--text);
}
.quiz-option:hover { border-color: var(--text-soft); }
.quiz-option.correct { background: #e8f5ee; border-color: var(--green); color: var(--green); }
.quiz-option.wrong { background: #fdecea; border-color: var(--red); color: var(--red); }

.lesson-nav { display: flex; justify-content: space-between; margin: 26px 0 10px; gap: 10px; }
.lesson-nav button {
  flex: 1; padding: 12px; background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; font-family: var(--sans); font-size: 11px; color: var(--text); text-align: left;
  border-radius: 2px;
}
.lesson-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.lesson-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.lesson-nav button .nav-label { display: block; color: var(--text-faded); font-size: 9px; margin-bottom: 4px; letter-spacing: 0.04em; }
.lesson-nav .next { text-align: right; }

#academy-intro { padding: 10px 0; }
#academy-intro h2 { font-size: 28px; font-weight: 500; margin-bottom: 4px; }
#academy-intro .intro-sub { color: var(--text-faded); font-size: 12px; margin-bottom: 22px; letter-spacing: 0.02em; }
#academy-intro p { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }

/* ─── Modal ─── */
#modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.2); z-index: 100;
  align-items: center; justify-content: center;
}
#modal-backdrop.open { display: flex; }
#modal {
  background: var(--bg); border: 1px solid var(--border); padding: 18px;
  width: 300px; max-height: 80vh; overflow-y: auto; border-radius: 3px;
}
/* §3 + §7 — shared backdrop class for the new modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-backdrop .modal {
  background: var(--bg); border: 1px solid var(--border); padding: 22px;
  width: 100%; max-width: 360px; max-height: 90vh; overflow-y: auto;
  border-radius: 4px;
}
body.theme-dark .modal-backdrop { background: rgba(0,0,0,0.6); }
#modal h3 { font-size: 11px; color: var(--text-faded); margin-bottom: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
.currency-group-title { font-size: 9px; letter-spacing: 0.1em; color: var(--text-faded); margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--border-light); text-transform: uppercase; }
.currency-option { display: flex; justify-content: space-between; padding: 7px 0; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.currency-option:hover { color: var(--accent); }
.currency-option.added { color: var(--text-faded); pointer-events: none; }
#modal-close { margin-top: 12px; font-size: 11px; color: var(--text-faded); cursor: pointer; background: none; border: none; }
#modal-close:hover { color: var(--text); }

/* ─── Toast ─── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white; font-size: 12px;
  padding: 8px 16px; border-radius: 2px; opacity: 0;
  pointer-events: none; transition: opacity 0.2s; z-index: 200;
}
#toast.show { opacity: 1; }

/* ─── Footer ─── */
#site-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faded);
  line-height: 1.7;
}
#site-footer .disclaimer-tagline { margin-bottom: 4px; }

/* ═══ §4 — Walkthrough sections ═══ */
.walk-through {
  margin-top: 14px;
  border-top: 1px dashed var(--border-light);
  padding-top: 10px;
}
.walk-through summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  padding: 6px 0;
  letter-spacing: 0.02em;
  list-style: none;
}
.walk-through summary:hover { color: var(--text); }
.walk-through summary::-webkit-details-marker { display: none; }
.walk-through summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s;
}
.walk-through[open] summary::before { transform: rotate(90deg); }
.walk-through-content {
  padding: 12px 14px;
  background: var(--bg-soft);
  border-left: 2px solid var(--accent);
  margin-top: 6px;
  border-radius: 0 2px 2px 0;
}
.walk-through-content p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 10px;
}
.walk-through-content p:last-child { margin-bottom: 0; }
.walk-through-content b { color: var(--text); font-weight: 600; }
.walk-through-content ul { margin: 6px 0 10px 22px; font-size: 13px; line-height: 1.7; }
.walk-through-content .warning-callout {
  background: #fef2f2;
  border-left: 2px solid var(--red);
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 12px;
  color: #7c2d2d;
}
body.theme-dark .walk-through-content .warning-callout {
  background: #2a1f1f;
  color: #d9685e;
}
body.theme-sepia .walk-through-content .warning-callout {
  background: #efe1c4;
  color: #8a3a2a;
}
body.theme-contrast .walk-through-content .warning-callout {
  background: #fff;
  color: #000;
  border-left-width: 4px;
}

/* ═══ §5.2 — Error box (validation) ═══ */
.error-box {
  background: #fef2f2;
  border-left: 3px solid var(--red);
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 12px;
  color: #7c2d2d;
  line-height: 1.6;
  border-radius: 0 2px 2px 0;
}
.error-box ul { margin: 6px 0 0 20px; }
.error-box li { margin-bottom: 4px; }
body.theme-dark .error-box { background: #2a1f1f; color: #d9685e; }
body.theme-sepia .error-box { background: #efe1c4; color: #8a3a2a; }
body.theme-contrast .error-box { background: #fff; color: #000; border-left-width: 4px; }

/* ═══ §3 — Donation bar ═══ */
#donation-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
  flex-wrap: wrap;
}
#donation-bar.hidden { display: none; }
.donation-link {
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: 0.02em;
}
.donation-link:hover { border-color: var(--accent); }
#donation-dismiss {
  background: none;
  border: none;
  color: var(--text-faded);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
#donation-dismiss:hover { color: var(--text); }

/* ═══ §6 — Setup Quality Scorer ═══ */
#setup-score-display {
  text-align: center;
  margin: 18px 0 14px;
}
.setup-score-num {
  display: inline-block;
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.setup-score-label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.setup-score-num.s5 { color: var(--green); }
.setup-score-num.s4 { color: var(--green); }
.setup-score-num.s3 { color: var(--accent); }
.setup-score-num.s2 { color: var(--red); }
.setup-score-num.s1 { color: var(--red); }
.setup-criterion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
}
.setup-criterion:first-child { border-top: none; }
.setup-criterion .mark {
  flex: 0 0 18px;
  font-weight: 600;
}
.setup-criterion.pass .mark { color: var(--green); }
.setup-criterion.fail .mark { color: var(--text-faded); }
.setup-criterion .name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.setup-criterion .detail {
  color: var(--text-faded);
  font-size: 12px;
  margin-top: 2px;
}

/* ═══ §5.3 — Inline help tooltips ═══ */
.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 10px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-faded);
  border: 1px solid var(--border);
  cursor: help;
  margin-left: 4px;
  font-weight: 500;
  vertical-align: middle;
}
.help-tip:hover { color: var(--accent); border-color: var(--accent); }
.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11px;
  width: 220px;
  white-space: normal;
  line-height: 1.45;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-weight: 400;
}
.help-tip:hover::after,
.help-tip.show-tip::after { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   MARKET CALENDAR
   ═══════════════════════════════════════════════════════════════════════════ */
#calendar-page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 30px 24px 60px;
}
@media (max-width: 600px) {
  #calendar-page { padding: 20px 14px 40px; }
}

/* Upcoming event cards */
.event-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  margin-bottom: 10px;
}
body.theme-dark .event-card { background: var(--bg-soft); }

.event-date {
  text-align: center;
  padding-top: 4px;
}
.event-day {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.event-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faded);
  margin-top: 2px;
}

.event-body { min-width: 0; }
.event-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.event-category {
  font-size: 11px;
  color: var(--text-faded);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.event-countdown {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.event-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-soft);
  padding: 4px 0;
  list-style: none;
}
.event-details summary::-webkit-details-marker { display: none; }
.event-details summary::before {
  content: '▸ ';
  color: var(--text-faded);
  display: inline-block;
  transition: transform 0.15s;
}
.event-details[open] summary::before { transform: rotate(90deg); }

.event-description {
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 2px;
  margin-top: 6px;
}
.event-description p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.event-description p:last-child { margin-bottom: 0; }
.event-warning {
  color: var(--red) !important;
  font-style: italic;
  font-size: 11px !important;
}
body.theme-dark .event-description { background: var(--bg); }

/* Historical comparison table */
.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
}
.event-comparison-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 12px;
}
.event-comparison-table th, .event-comparison-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.event-comparison-table th {
  font-size: 10px;
  color: var(--text-faded);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.event-comparison-table td.num {
  text-align: right;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 11px;
}
.event-comparison-table .pos { color: var(--green); }
.event-comparison-table .neg { color: var(--red); }
.event-comparison-table .flat { color: var(--text-faded); }
.event-comparison-table .event-row-label {
  color: var(--text-soft);
  font-size: 11px;
}
.event-comparison-table tbody tr:hover {
  background: var(--bg-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER SOCIAL LINKS
   ═══════════════════════════════════════════════════════════════════════════ */
#footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-faded);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.footer-social-link svg { flex-shrink: 0; }
.footer-social-link:hover { color: var(--accent); }
/* The Bitcointalk link is the priority — give it the accent color by default
   so it stands out as the main community hub. */
.footer-social-link[data-social="bitcointalk"] { color: var(--accent); font-weight: 500; }
.footer-social-link[data-social="bitcointalk"]:hover { color: var(--text); }

@media (max-width: 480px) {
  /* On very small screens, hide the text labels and show icons only,
     except keep the Bitcointalk label since it's the priority link. */
  .footer-social-link span { display: none; }
  .footer-social-link[data-social="bitcointalk"] span { display: inline; }
  #footer-social { gap: 18px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NoFomoBTC V3 — PHASE A (UX FOUNDATION)
   All colors use existing theme vars so every block works in light/dark/
   sepia/contrast. --amber is the one new var (stale-data warning), defined
   per theme below.
   ═══════════════════════════════════════════════════════════════════════════ */
:root { --amber: #b5790f; }
body.theme-dark    { --amber: #e0a850; }
body.theme-sepia   { --amber: #9a6a1a; }
body.theme-contrast{ --amber: #7a4e00; }

/* ─── §A3 header search button ─── */
#search-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-soft); display: flex; align-items: center;
  padding: 4px; border-radius: 4px;
}
#search-btn:hover { color: var(--accent); }

/* ─── §A2 sticky mini price bar (sits just under the sticky #topbar) ─── */
#mini-price-bar {
  position: fixed; top: var(--topbar-h, 52px); left: 0; right: 0; height: 34px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: none; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--text-soft); z-index: 45; cursor: pointer;
}
#mini-price-bar.visible { display: flex; }
#mini-price-bar .mpb-up   { color: var(--green); }
#mini-price-bar .mpb-down { color: var(--red); }
#mini-price-bar .mpb-ago  { color: var(--text-faded); font-size: 11px; }
#mini-price-bar .mpb-ago.stale { color: var(--amber); }

/* ─── §A5 skeleton loaders ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-light) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 3px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-chart { width: 100%; height: 240px; margin-bottom: 8px; }
.skeleton-gauge { width: 100%; height: 160px; border-radius: 6px; }
.skeleton-line  { height: 12px; margin: 6px 0; }
.skeleton-cell .skeleton-line:first-child { margin-top: 0; }
.fresh-stamp { font-size: 11px; color: var(--text-faded); }
.fresh-stamp.stale { color: var(--amber); }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ─── §A3 global search modal ─── */
#search-backdrop { align-items: flex-start; }
#search-backdrop .modal { margin-top: 10vh; }
.search-modal { max-width: 540px; }
.search-input-wrap {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px;
  color: var(--text-faded);
}
.search-input-wrap:focus-within { border-color: var(--accent); }
#search-input {
  flex: 1; border: none; background: none; outline: none;
  font-family: var(--sans); font-size: 15px; color: var(--text);
}
#search-results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
#search-results li {
  padding: 9px 10px; border-radius: 4px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
#search-results li.active, #search-results li:hover { background: var(--bg-soft); }
#search-results .sr-title { font-size: 13px; color: var(--text); }
#search-results .sr-sub   { font-size: 11px; color: var(--text-faded); }
#search-results .sr-tab   { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
#search-results .sr-empty { padding: 14px 10px; color: var(--text-faded); font-size: 12px; }
.search-hint { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--text-faded); }
.search-hint kbd {
  font-family: var(--sans); border: 1px solid var(--border); border-radius: 3px;
  padding: 0 4px; margin-right: 2px; font-size: 10px;
}

/* ─── §A1 first-visit guided tour ─── */
#tour-overlay { position: fixed; inset: 0; z-index: 150; }
#tour-overlay.hidden { display: none; }
#tour-highlight {
  position: absolute; border-radius: 6px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.6); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
}
#tour-card {
  position: absolute; width: min(320px, 90vw);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); z-index: 151;
}
#tour-step-count { font-size: 11px; color: var(--text-faded); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
#tour-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
#tour-body  { font-size: 13px; line-height: 1.6; color: var(--text-soft); }
#tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }
.tour-btn-skip { background: none; border: none; color: var(--text-faded); cursor: pointer; font-size: 12px; font-family: var(--sans); }
.tour-btn-skip:hover { color: var(--text); }
.tour-btn-next {
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  padding: 7px 16px; cursor: pointer; font-size: 13px; font-family: var(--sans); font-weight: 500;
}

/* ─── §A1 footer "Take the tour" ─── */
#footer-actions { margin: 4px 0 10px; }
.footer-link-btn {
  background: none; border: 1px solid var(--border); border-radius: 14px;
  color: var(--text-soft); cursor: pointer; font-family: var(--sans);
  font-size: 12px; padding: 5px 14px;
}
.footer-link-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── §A4 mobile bottom navigation ─── */
#bottom-nav { display: none; }
@media (max-width: 600px) {
  /* Hide the top tab row; the bottom nav replaces it to reclaim space. */
  #tabs { display: none; }
  /* Keep page content + footer clear of the fixed bottom nav. */
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  #bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
    background: var(--bg); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #bottom-nav .bnav-btn {
    flex: 1; background: none; border: none; cursor: pointer; color: var(--text-faded);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 0 6px; font-family: var(--sans); font-size: 10px; letter-spacing: 0.02em;
  }
  #bottom-nav .bnav-btn.active { color: var(--accent); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NoFomoBTC V3 — PHASE B (TIME MACHINE)
   A humility-trainer game in the Academy. Neutral styling on purpose — no
   green/red on the answer buttons (that would read as a signal/bias). Reuses
   .ind-card / .ind-row / .signal-* for the indicator breakdown.
   ═══════════════════════════════════════════════════════════════════════════ */
#tm-wrap { margin-top: 6px; }
.tm-chart-box { margin: 14px 0 6px; }
#tm-chart-canvas { width: 100%; height: 260px; display: block; }
#tm-rsi-canvas, #tm-macd-canvas { width: 100%; height: 78px; display: block; margin-top: 8px; }
.tm-cap { font-size: 11px; color: var(--text-faded); margin: 6px 0 2px; }
.tm-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-soft); margin: 6px 0; }
.tm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tm-legend i { width: 14px; height: 2px; display: inline-block; border-radius: 1px; }

.tm-ind-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin: 14px 0;
}

.tm-question { margin: 18px 0 6px; text-align: center; }
.tm-question .tm-q-text { font-size: 15px; color: var(--text); margin-bottom: 12px; }
.tm-choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tm-choice-btn {
  flex: 1; min-width: 120px; max-width: 220px;
  padding: 14px 18px; font-size: 16px; font-weight: 500; letter-spacing: 0.04em;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  font-family: var(--sans); transition: var(--transition);
}
.tm-choice-btn:hover { border-color: var(--accent); color: var(--accent); }
.tm-choice-btn:disabled { opacity: 0.5; cursor: default; }
.tm-confidence {
  margin: 14px 0 4px; font-size: 13px; color: var(--text-soft);
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; align-items: center;
}
.tm-confidence label { cursor: pointer; }

.tm-reveal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.tm-reveal.hidden { display: none; }
.tm-result { font-size: 15px; line-height: 1.6; color: var(--text); }
.tm-result .tm-move-up { color: var(--green); font-weight: 600; }
.tm-result .tm-move-down { color: var(--red); font-weight: 600; }
.tm-result .tm-move-flat { color: var(--text-faded); font-weight: 600; }
.tm-context { font-size: 13px; color: var(--text-soft); font-style: italic; margin-top: 6px; }
.tm-next-wrap { margin-top: 14px; }

.tm-stats {
  margin-top: 18px; padding: 14px; border-radius: 4px;
  background: var(--bg-soft); border: 1px solid var(--border-light);
}
.tm-stats .tm-acc { font-size: 14px; color: var(--text); }
.tm-stats .tm-baseline { color: var(--text-faded); }
.tm-stats .tm-conf-line { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.tm-lesson {
  margin-top: 12px; padding: 12px 14px; border-radius: 4px; font-size: 13px; line-height: 1.6;
  background: var(--bg); border-left: 2px solid var(--accent); color: var(--text-soft);
}
.tm-rules { font-size: 11px; color: var(--text-faded); margin-top: 10px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   NoFomoBTC V3 — PHASE C (ACADEMY 2.0)
   Sub-nav, progress dashboard, glossary, scam radar + quiz, crash museum.
   Theme-aware via vars; works in all 4 themes + Simple/Detailed.
   ═══════════════════════════════════════════════════════════════════════════ */
#academy-head { margin-bottom: 18px; }
.academy-title { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
#academy-subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.asub-btn {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg); color: var(--text-soft); cursor: pointer;
  font-family: var(--sans); font-size: 13px; transition: var(--transition);
}
.asub-btn:hover { border-color: var(--accent); color: var(--text); }
.asub-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.academy-section { display: none; }
.academy-section.active { display: block; }

/* §C4 progress dashboard */
#academy-dashboard {
  display: flex; gap: 16px; align-items: center; padding: 16px; margin-bottom: 18px;
  background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: 6px;
}
.dash-ring {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--border-light) 0);
  display: flex; align-items: center; justify-content: center;
}
.dash-ring-inner {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.dash-ring-inner b { font-size: 18px; color: var(--text); }
.dash-ring-inner span { font-size: 9px; color: var(--text-faded); }
.dash-body { flex: 1; min-width: 0; }
.dash-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dash-sub { font-size: 12px; color: var(--text-faded); margin: 2px 0 10px; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* §C1 glossary */
#glossary-controls { margin: 14px 0; }
#glossary-search {
  width: 100%; max-width: 360px; border: 1px solid var(--border); border-radius: 4px;
  padding: 9px 12px; font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--bg); outline: none;
}
#glossary-search:focus { border-color: var(--accent); }
#glossary-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.gtag {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
  color: var(--text-soft); cursor: pointer; font-family: var(--sans); font-size: 11px;
}
.gtag:hover { border-color: var(--accent); }
.gtag.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.glossary-letter { font-size: 12px; font-weight: 700; color: var(--accent); margin: 16px 0 4px; letter-spacing: 0.08em; }
.glossary-item { border-bottom: 1px solid var(--border-light); padding: 4px 0; }
.glossary-item summary {
  cursor: pointer; padding: 8px 4px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  list-style: none;
}
.glossary-item summary::-webkit-details-marker { display: none; }
.glossary-item .g-term { font-size: 14px; color: var(--text); font-weight: 500; }
.g-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.g-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faded); border: 1px solid var(--border-light); border-radius: 8px; padding: 1px 6px; }
.glossary-item .g-def { font-size: 13px; line-height: 1.6; color: var(--text-soft); padding: 0 4px 10px; }
.glossary-hit { background: var(--bg-soft); border-radius: 4px; }
.glossary-hit summary .g-term { color: var(--accent); }

/* §C2 scam radar */
.scam-card { border: 1px solid var(--border-light); border-radius: 5px; margin-bottom: 8px; background: var(--bg-soft); }
.scam-card summary { cursor: pointer; padding: 12px 14px; list-style: none; font-size: 14px; font-weight: 500; color: var(--text); }
.scam-card summary::-webkit-details-marker { display: none; }
.scam-card summary::before { content: '⚠ '; color: var(--accent); }
.scam-card .scam-how { font-size: 13px; line-height: 1.65; color: var(--text-soft); padding: 0 14px 8px; }
.scam-flags-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faded); padding: 0 14px; }
.scam-flags { margin: 4px 0 8px; padding: 0 14px 0 32px; }
.scam-flags li { font-size: 13px; line-height: 1.6; color: var(--text-soft); margin-bottom: 3px; }
.scam-todo { font-size: 13px; line-height: 1.6; color: var(--text); background: var(--bg); border-top: 1px solid var(--border-light); padding: 10px 14px; border-radius: 0 0 5px 5px; }

.scam-quiz-card { border: 1px solid var(--border-light); border-radius: 6px; padding: 14px; margin-bottom: 14px; }
.sqc-platform { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faded); margin-bottom: 8px; }
.sqc-msg { font-size: 14px; line-height: 1.9; color: var(--text); background: var(--bg-soft); border-radius: 6px; padding: 12px 14px; }
.qword { cursor: pointer; border-radius: 3px; padding: 1px 1px; transition: background 0.12s; }
.qword:hover { background: var(--border-light); }
.qword.tapped { background: var(--border-light); box-shadow: inset 0 -2px 0 var(--accent); }
.scam-quiz-card.done .qword { cursor: default; }
.qword.flag-real { box-shadow: inset 0 -2px 0 var(--red); }
.qword.hit { box-shadow: inset 0 -2px 0 var(--green); }
.qword.false-alarm { text-decoration: line-through; color: var(--text-faded); box-shadow: none; }
.sqc-hint { font-size: 11px; color: var(--text-faded); margin: 8px 0; }
.sqc-actions { margin-top: 6px; }
.sqc-result { margin-top: 10px; }
.sqc-score { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.sqc-expl { margin: 0 0 0 18px; padding: 0; }
.sqc-expl li { font-size: 12px; line-height: 1.6; color: var(--text-soft); margin-bottom: 4px; }
#scam-quiz-closing { margin-top: 14px; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--bg-soft); font-size: 13px; line-height: 1.6; color: var(--text-soft); border-radius: 0 4px 4px 0; }

/* §C3 crash museum */
.crash-card { border: 1px solid var(--border-light); border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; background: var(--bg-soft); }
.crash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.crash-name { font-size: 15px; font-weight: 600; color: var(--text); }
.crash-drop { font-size: 15px; font-weight: 700; color: var(--red); white-space: nowrap; }
.crash-nums { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.crash-nums b { color: var(--text-faded); font-weight: 500; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; margin-right: 4px; }
.crash-story { font-size: 13px; line-height: 1.7; color: var(--text-soft); }
.crash-mood { font-size: 13px; line-height: 1.6; color: var(--text); font-style: italic; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.crash-tk-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 22px 0 8px; padding-left: 10px; border-left: 2px solid var(--accent); }
.crash-tk-list { margin: 0 0 0 18px; padding: 0; }
.crash-tk-list li { font-size: 13px; line-height: 1.7; color: var(--text-soft); margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   NoFomoBTC V3 — PHASE D (TOOLS DEPTH)
   Network tab + journal insights. (§D3 verdict + §D2 DCA reuse existing styles.)
   ═══════════════════════════════════════════════════════════════════════════ */
/* §D4 journal insights */
.ji-locked { font-size: 13px; line-height: 1.6; color: var(--text-faded); background: var(--bg-soft); border: 1px dashed var(--border); border-radius: 6px; padding: 14px; margin-top: 14px; }
.ji-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 20px 0 4px; letter-spacing: 0.04em; text-transform: uppercase; }
.ji-framing { font-size: 12px; color: var(--text-faded); line-height: 1.6; margin-bottom: 12px; }
.ji-grid { margin-bottom: 8px; }
.ji-reasons { margin-top: 10px; }
.ji-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faded); margin-bottom: 6px; }
.ji-reason-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-soft); padding: 5px 0; border-bottom: 1px solid var(--border-light); }
.ji-note { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--bg-soft); font-size: 12px; line-height: 1.6; color: var(--text-soft); border-radius: 0 4px 4px 0; }

/* §D1 network tab */
.net-updated { font-size: 11px; color: var(--text-faded); margin-top: 6px; }
.net-fail { font-size: 12px; color: var(--text-faded); padding: 8px 0; }
.net-fee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.net-fee-card { background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: 5px; padding: 12px; text-align: center; }
.nf-label { font-size: 11px; color: var(--text-faded); }
.nf-rate { font-size: 22px; font-weight: 600; color: var(--text); margin: 4px 0; }
.nf-rate span { font-size: 11px; font-weight: 400; color: var(--text-faded); }
.nf-sub { font-size: 10px; color: var(--text-faded); text-transform: uppercase; letter-spacing: 0.04em; }
.net-urgency { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.net-urg-btn { padding: 7px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text-soft); cursor: pointer; font-family: var(--sans); font-size: 13px; }
.net-urg-btn:hover { border-color: var(--accent); }
.net-urg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.net-fee-cost { font-size: 14px; color: var(--text); line-height: 1.7; }
.nf-usd { font-size: 18px; font-weight: 600; color: var(--accent); margin-top: 4px; }
.net-busy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-soft); }
.net-busy-badge { font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 14px; color: #fff; }
.net-busy-badge.quiet { background: var(--green); }
.net-busy-badge.normal { background: var(--text-soft); }
.net-busy-badge.busy { background: var(--amber); }
.net-busy-badge.congested { background: var(--red); }
.net-big { font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.1; letter-spacing: -0.01em; }
.net-big-sub { font-size: 11px; color: var(--text-faded); margin-top: 3px; }
.net-halving-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.net-halving-date { text-align: right; }
.net-epoch { margin-top: 14px; }
.net-epoch-label { font-size: 11px; color: var(--text-faded); margin-bottom: 5px; }
.net-epoch-bar { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.net-epoch-fill { height: 100%; background: var(--accent); transition: width 0.4s; }

