/* OptionGap — Documentation tab */

.docs-root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */

.docs-sidebar {
  position: sticky;
  top: 80px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 12px 8px;
}

.docs-sidebar-hd {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2, #8a91a0);
  padding: 4px 10px 10px;
}

.docs-nav-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg-2, #8a91a0);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.docs-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--fg-1, #c8d0db);
}
.docs-nav-item.on {
  background: hsl(var(--accent-h, 268) 70% 55% / 0.12);
  color: hsl(var(--accent-h, 268) 85% 70%);
}

.docs-nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.75;
  font-style: italic;
}

/* ── Content ───────────────────────────────────────────────────────────── */

.docs-content {
  min-width: 0;
}

.docs-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.docs-h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--fg-0, #fff);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.docs-h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-0, #fff);
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  letter-spacing: -0.01em;
}

.docs-h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-1, #c8d0db);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.docs-p {
  font-size: 13.5px;
  color: var(--fg-1, #c8d0db);
  line-height: 1.7;
  margin: 0 0 12px;
}

/* ── Formula blocks ────────────────────────────────────────────────────── */

.docs-formula-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid hsl(var(--accent-h, 268) 70% 55%);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 10px 0 16px;
}

.docs-formula-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-2, #8a91a0);
  margin-bottom: 6px;
}

.docs-formula {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13.5px;
  color: hsl(var(--accent-h, 268) 85% 75%);
  line-height: 1.6;
}

.docs-formula-note {
  font-size: 11px;
  color: var(--fg-2, #8a91a0);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.docs-table-wrap {
  overflow-x: auto;
  margin: 10px 0 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.docs-table thead th {
  background: rgba(255,255,255,0.04);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-2, #8a91a0);
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.docs-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--fg-1, #c8d0db);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

/* ── Lists ─────────────────────────────────────────────────────────────── */

.docs-list {
  padding-left: 20px;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.docs-list li {
  font-size: 13px;
  color: var(--fg-1, #c8d0db);
  line-height: 1.6;
}

.docs-list--ol {
  list-style-type: decimal;
}

.docs-list li strong {
  color: var(--fg-0, #fff);
}

/* ── Callout boxes ─────────────────────────────────────────────────────── */

.docs-callout {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0 20px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg-1, #c8d0db);
}

.docs-callout strong {
  color: var(--fg-0, #fff);
}

.docs-callout--info {
  background: hsl(var(--accent-h, 268) 70% 55% / 0.08);
  border: 1px solid hsl(var(--accent-h, 268) 70% 55% / 0.2);
}

.docs-callout--tip {
  background: hsl(150 70% 55% / 0.08);
  border: 1px solid hsl(150 70% 55% / 0.2);
}

.docs-callout--warn {
  background: hsl(38 90% 60% / 0.08);
  border: 1px solid hsl(38 90% 60% / 0.2);
}

/* ── Badge ─────────────────────────────────────────────────────────────── */

.docs-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Regime grid (VIX / Breadth zones) ────────────────────────────────── */

.docs-regime-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 20px;
}

.docs-regime-row {
  display: grid;
  grid-template-columns: 90px 110px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}

.docs-regime-range {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 3px;
}

.docs-regime-desc {
  font-size: 12px;
  color: var(--fg-2, #8a91a0);
  line-height: 1.55;
}

.docs-regime-axes {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.docs-regime-axis-tag {
  font-size: 10.5px;
  color: var(--fg-2, #8a91a0);
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.docs-regime-axis-sep {
  color: var(--fg-2, #8a91a0);
  font-size: 10px;
}

/* ── RRG quadrant 2×2 layout ───────────────────────────────────────────── */

.docs-rrg-quad-layout {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 14px 0 20px;
}

/* Vertical Y-axis label */
.docs-rrg-yaxis-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-2, #8a91a0);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  min-width: 18px;
  user-select: none;
}

.docs-rrg-quad-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* 2×2 grid — top-left=Improving, top-right=Leading, bottom-left=Lagging, bottom-right=Weakening */
.docs-rrg-quad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.docs-rrg-quad {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-rrg-quad-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.docs-rrg-quad-desc {
  font-size: 0.82rem;
  color: var(--fg-1, #c8d0db);
  line-height: 1.55;
  flex: 1;
}

.docs-rrg-quad-coords {
  font-size: 0.7rem;
  color: var(--fg-2, #8a91a0);
  font-weight: 500;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

/* X-axis label below the grid */
.docs-rrg-xaxis-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-2, #8a91a0);
  padding: 0 2px;
  user-select: none;
}

/* Clockwise rotation flow hint */
.docs-rrg-rotation-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-2, #8a91a0);
  padding: 8px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.docs-rrg-rotation-hint span { white-space: nowrap; }
.docs-rrg-rotation-arrow { opacity: 0.5; font-size: 0.9rem; }

@media (max-width: 640px) {
  .docs-rrg-quad-layout { flex-direction: column; }
  .docs-rrg-yaxis-label { writing-mode: horizontal-tb; transform: none; flex-direction: row; min-width: auto; min-height: 18px; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .docs-root {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }
  .docs-sidebar-hd { display: none; }
  .docs-nav-item {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
  }
  .docs-regime-row {
    grid-template-columns: 80px 1fr;
  }
  .docs-regime-row .docs-badge {
    display: none;
  }
}
