/* ── Learn page layout ───────────────────────────────────────────────────── */
.learn-page-title { font-size: 22px; font-weight: 700; }

.learn-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.learn-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.learn-section-icon { font-size: 24px; flex-shrink: 0; }
.learn-section h2   { font-size: 17px; font-weight: 700; }

/* ── Body text ───────────────────────────────────────────────────────────── */
.learn-body { font-size: 13.5px; line-height: 1.8; color: #c9d1d9; }
.learn-body p   { margin-bottom: 12px; }
.learn-body h4  { font-size: 13px; font-weight: 700; color: #e6edf3;
                  margin: 20px 0 10px; text-transform: uppercase;
                  letter-spacing: 0.5px; }
.learn-body ul, .learn-body ol { padding-left: 20px; margin-bottom: 12px; }
.learn-body li  { margin-bottom: 6px; }
.learn-body strong { color: #e6edf3; }
.learn-body em     { color: #90a4ae; font-style: italic; }

/* ── TOC ─────────────────────────────────────────────────────────────────── */
.learn-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-link {
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-link:hover { background: var(--bg3); color: var(--text); }

/* ── Callouts ────────────────────────────────────────────────────────────── */
.learn-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.learn-callout.info    { background: rgba(88,166,255,0.08);  border-left: 3px solid #58a6ff; }
.learn-callout.tip     { background: rgba(63,185,80,0.08);   border-left: 3px solid #3fb950; }
.learn-callout.warning { background: rgba(210,153,34,0.08);  border-left: 3px solid #d29922; }

/* ── Candle diagram ──────────────────────────────────────────────────────── */
.candle-diagram {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  padding: 20px 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.candle-example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.candle-part { width: 44px; position: relative; }
.wick-top, .wick-bottom { height: 28px; display: flex; justify-content: center; }
.green-wick::after, .red-wick::after {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
}
.green-wick::after { background: #3fb950; }
.red-wick::after   { background: #f85149; }

.body-green, .body-red {
  height: 80px;
  border-radius: 3px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.body-green { background: rgba(63,185,80,0.3); border: 2px solid #3fb950; }
.body-red   { background: rgba(248,81,73,0.3);  border: 2px solid #f85149; }

.candle-label-right {
  position: absolute;
  left: 52px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.candle-label-right:first-child { top: 4px; }
.candle-label-right:last-child  { bottom: 4px; }
.candle-caption {
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}
.candle-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  margin-left: 24px;
}
.legend-item  { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.legend-line  { display: inline-block; width: 24px; height: 2px; background: var(--text-muted); }
.legend-line.thin { height: 1px; }

/* ── Calc tables & formulas ──────────────────────────────────────────────── */
.calc-table {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 16px 0;
  flex-wrap: wrap;
}
.calc-table table {
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg3);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.calc-table th, .calc-table td {
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.calc-table th { background: var(--bg); color: var(--text-muted); font-size: 11px;
                 text-transform: uppercase; letter-spacing: 0.6px; }
.calc-table tr:last-child td { border-bottom: none; }

.calc-formula {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
  line-height: 1.8;
  flex: 1;
  min-width: 220px;
}
.calc-formula.standalone { margin: 16px 0; display: block; }
.calc-formula.small { font-size: 12px; padding: 10px 14px; margin: 8px 0; }
.formula-title  { font-size: 11px; color: var(--text-muted); margin-bottom: 8px;
                  text-transform: uppercase; letter-spacing: 0.6px; font-family: inherit; }
.formula-line   { color: var(--text-muted); }
.formula-result { color: var(--accent2); font-weight: 600; border-top: 1px solid var(--border);
                  margin-top: 8px; padding-top: 8px; }

/* ── MA cards ────────────────────────────────────────────────────────────── */
.ma-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.ma-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 14px;
}
.ma-label { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ma-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ── Cross cards ─────────────────────────────────────────────────────────── */
.cross-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.cross-card {
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}
.cross-card.bull { background: rgba(63,185,80,0.06);  border-left: 3px solid #3fb950; }
.cross-card.bear { background: rgba(248,81,73,0.06);   border-left: 3px solid #f85149; }
.cross-icon  { font-size: 24px; margin-bottom: 8px; }
.cross-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.cross-body  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ── RSI scale ───────────────────────────────────────────────────────────── */
.rsi-scale {
  display: flex;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.rsi-zone {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  text-align: center;
}
.rsi-zone span:first-child, .rsi-zone span:last-child {
  font-weight: 700; font-size: 14px;
}
.bear-zone    { background: rgba(248,81,73,0.1);  color: #f85149; }
.neutral-zone { background: rgba(255,255,255,0.03); color: var(--text-muted); }
.bull-zone    { background: rgba(63,185,80,0.1);  color: #3fb950; }

/* ── Example box ─────────────────────────────────────────────────────────── */
.example-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

/* ── MACD metric cards ───────────────────────────────────────────────────── */
.macd-cards { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.learn-metric-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.metric-label { font-size: 12px; font-weight: 700; color: var(--accent2);
                text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.metric-body  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── Bollinger signals ───────────────────────────────────────────────────── */
.bb-signals { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.bb-signal {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
}
.bb-signal p      { margin: 6px 0 0; color: var(--text-muted); }
.bb-signal.bull   { border-left: 3px solid #3fb950; background: rgba(63,185,80,0.05); }
.bb-signal.bear   { border-left: 3px solid #f85149; background: rgba(248,81,73,0.05); }
.bb-signal.neutral{ border-left: 3px solid #d29922; background: rgba(210,153,34,0.05); }

/* ── Fundamentals grid ───────────────────────────────────────────────────── */
.fund-explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.fund-explain-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
}
.fund-explain-card p { margin-bottom: 8px; color: var(--text-muted); }
.fec-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.fec-abbr { font-size: 18px; font-weight: 800; color: var(--accent2); }
.fec-name { font-size: 12px; color: var(--text-muted); }

/* ── Checklist ───────────────────────────────────────────────────────────── */
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.checklist-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.checklist-section.bull { border-left: 3px solid #3fb950; }
.checklist-section.bear { border-left: 3px solid #f85149; }
.cl-header { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.checklist-section ul { padding-left: 18px; margin: 0; }
.checklist-section li { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.5; }

/* ── Analysis steps ──────────────────────────────────────────────────────── */
.analysis-steps {
  padding-left: 20px;
  margin: 0;
}
.analysis-steps li {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}
.analysis-steps strong { color: var(--text); }

/* ── Glossary ────────────────────────────────────────────────────────────── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.glossary-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.glossary-term { font-size: 13px; font-weight: 700; color: var(--accent2); margin-bottom: 4px; }
.glossary-def  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .cross-cards, .checklist { grid-template-columns: 1fr; }
  .candle-diagram           { flex-direction: column; }
}
