/* =========================================================
   docs.css — Docs page only
   - Scenario-like tabs (raised tabs + active connected panel)
   - Right rail: BOOK ONLY (paper moved into References tab)
   - Risk Numbers: make TableEngine look like PDE settings (no extra framed box)

   UPDATE (2026-01-23):
   - Force Risk Numbers table to respect spec column widths:
       * table-layout: fixed
       * width: 100%
     (TableEngine renders a real table; CSS must enforce layout.)
   - Fix: previous selector used "#riskNumbersTable table" which never matched
     because #riskNumbersTable IS the table element.
   - Force wrapping in Units column (covers TE inner wrappers that may set
     nowrap/ellipsis).
   ========================================================= */

:root{
  --docs-maxw: 1100px;
  --docs-gap: 22px;
  --docs-border: rgba(255,255,255,0.06);
  --docs-border-strong: rgba(255,255,255,0.10);
  --docs-card: rgba(255,255,255,0.02);
  --docs-hero: rgba(255,255,255,0.03);
  --docs-text-muted: rgba(230,245,255,0.78);
  --docs-text: rgba(230,245,255,0.92);
  --docs-accent: rgba(85,182,211,0.55);
}

.docs-wrap{
  max-width: var(--docs-maxw);
  margin: 0 auto;
  padding: 26px 18px 34px;
}

/* =========================================================
   HERO header + right rail (book only)
   ========================================================= */

.docs-hero{
  display:flex;
  gap: var(--docs-gap);
  align-items:flex-start;
  justify-content:space-between;

  padding: 18px 18px 16px;
  border-radius: 18px;

  background: var(--docs-hero);
  border: 1px solid var(--docs-border);
}

.docs-hero h1{
  margin:0;
  font-size: 34px;
  letter-spacing: -0.4px;
  color: var(--docs-text);
}

.docs-hero p{
  margin: 10px 0 0 0;
  max-width: 680px;
  line-height: 1.5;
  color: var(--docs-text-muted);
}

.docs-hero strong{ color: var(--docs-text); }

.docs-rail{
  flex: 0 0 260px;
  width: 260px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.docs-book img{
  display:block;
  width: 100%;
  height:auto;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.docs-book .cap{
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
  opacity: .82;
  color: var(--docs-text-muted);
}

.docs-book .cap .ttl{
  font-weight: 850;
  opacity: .95;
  color: var(--docs-text);
}

/* Mobile: hide rail */
@media (max-width: 900px){
  .docs-rail{ display:none; }
}

/* =========================================================
   Scenario-like tab strip (raised tabs)
   ========================================================= */

.docs-tabs{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--docs-border);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}

.docs-tabbar{
  display:flex;
  gap: 12px;
  padding: 12px 12px 0 12px;

  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.docs-tab{
  appearance:none;
  -webkit-appearance:none;

  border: 1px solid rgba(255,255,255,0.09);
  border-bottom: none;
  background: rgba(255,255,255,0.03);

  color: rgba(230,245,255,0.90);
  font: inherit;
  font-weight: 900;

  padding: 12px 18px;
  border-radius: 14px 14px 0 0;

  cursor:pointer;
  user-select:none;

  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
  opacity: .92;
}

.docs-tab:hover{ opacity: 1; }

.docs-tab:focus-visible{
  outline: 2px solid var(--docs-accent);
  outline-offset: 2px;
}

.docs-tab[aria-selected="true"]{
  background: rgba(7, 32, 64, 0.55);
  border-color: rgba(255,255,255,0.14);
  opacity: 1;
  position: relative;
  top: 1px;
}

/* =========================================================
   Panels + sections
   ========================================================= */

.docs-panel{ padding: 16px; }
.docs-panel[hidden]{ display:none; }

.docs-section{
  border-radius: 16px;
  background: var(--docs-card);
  border: 1px solid var(--docs-border);
  padding: 16px;
  margin: 0 0 14px 0;
}

.docs-section h2{
  margin: 0 0 10px 0;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: var(--docs-text);
}

.docs-muted{
  color: var(--docs-text-muted);
  line-height: 1.5;
}

.docs-hr{
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 0;
}

/* cards grid */
.docs-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 900px){
  .docs-grid{ grid-template-columns: 1fr; }
}

.docs-card{
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--docs-border);
  padding: 14px;
}

.docs-card h3{
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--docs-text);
}

.docs-card ul{
  margin: 10px 0 0 18px;
  padding: 0;
}

.docs-card li{
  margin: 6px 0;
  opacity: .92;
  color: rgba(230,245,255,0.86);
}

/* kv rows */
.docs-kv{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  margin-top: 10px;
}
.docs-kv .k{ opacity:.75; color: var(--docs-text-muted); }
.docs-kv .v{ opacity:.92; color: var(--docs-text); }

/* =========================================================
   References entries
   ========================================================= */

.docs-ref{
  display:flex;
  gap: 12px;
  align-items:flex-start;

  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.docs-ref + .docs-ref{ margin-top: 10px; }

.docs-ref .tag{
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .65;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
}

.docs-ref .body{ min-width: 0; }

.docs-ref .title{
  font-weight: 950;
  letter-spacing: -0.2px;
  color: var(--docs-text);
  margin: 0 0 4px 0;
}

.docs-ref .desc{
  margin: 0 0 8px 0;
  color: var(--docs-text-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.docs-ref .actions{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
}

.docs-ref .actions a{
  text-decoration: none;
  font-weight: 900;
  opacity: .92;
  border-bottom: 1px solid rgba(230,245,255,0.22);
  color: var(--docs-text);
}
.docs-ref .actions a:hover{
  opacity: 1;
  border-bottom-color: rgba(85,182,211,0.65);
}

.docs-ref code{ opacity: .92; }

/* =========================================================
   Risk Numbers: TableEngine host
   - Do NOT add another card/border here; PDE settings is “just the table”.
   ========================================================= */

.docs-table-host{
  margin-top: 8px;
}

/* Make sure any global “height:100%” rules don’t blow it up */
.docs-table-host,
.docs-table{
  height: auto !important;
  min-height: 0 !important;
}

.docs-table{
  width: 100%;
}

/* =========================================================
   Links: kill visited purple (stronger than global)
   ========================================================= */

.docs-wrap a,
.docs-wrap a:visited,
.docs-section a,
.docs-section a:visited,
.docs-muted a,
.docs-muted a:visited{
  color: rgba(230,245,255,0.92) !important;
}

.docs-wrap a:hover,
.docs-section a:hover,
.docs-muted a:hover{
  color: rgba(85,182,211,1) !important;
}

/* Keep the “docs links list” underline style */
.docs-links a,
.docs-links a:visited{
  color: rgba(230,245,255,0.92) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .92;
}
.docs-links a:hover{
  opacity: 1;
}

/* =========================================================
   Risk Numbers (TableEngine) — make it look like PDE settings
   IMPORTANT:
   - Don't guess TE internal classnames (.te-table may not exist).
   - Style the actual table under #riskNumbersTable.
   - Force fixed table layout so spec column widths are honored.
   ========================================================= */

/* TableEngine table element IS #riskNumbersTable */
#riskNumbersTable{
  width: 100%;
  table-layout: fixed;           /* <-- key: honor spec widths */
  border-collapse: separate;     /* matches many TE themes */
  border-spacing: 0;
}

/* Header: prevent "Risk numberDescription" jam if TE css isn't applied */
#riskNumbersTable thead th{
  white-space: nowrap;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Cells: PDE-like spacing */
#riskNumbersTable th,
#riskNumbersTable td{
  vertical-align: top;

  /* wrapping: readable long text without breaking layout */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
}

#riskNumbersTable td{
  padding: 10px 12px;
}

/* Row separators */
#riskNumbersTable tbody tr td{
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#riskNumbersTable tbody tr:last-child td{
  border-bottom: none;
}

/* Make long text easier to scan */
#riskNumbersTable td.te-desc{
  line-height: 1.35;
}

/* First column: breathing room */
#riskNumbersTable td.te-param{
  padding-right: 16px;
}

/* Optional hover like a sheet */
#riskNumbersTable tbody tr:hover td{
  background: rgba(255,255,255,0.02);
}

/* =========================================================
   Risk Numbers — Units column must WRAP (fix TE ellipsis/no-wrap)
   ========================================================= */

/* 1) Force wrapping on the units cells themselves */
#riskNumbersTable td.te-units{
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  hyphens: auto;
}

/* 2) Force wrapping on common TE inner wrappers (covers ellipsis styles) */
#riskNumbersTable td.te-units > *,
#riskNumbersTable td.te-units .te-cell,
#riskNumbersTable td.te-units .te-cell-inner,
#riskNumbersTable td.te-units .te-cell-value,
#riskNumbersTable td.te-units .te-value,
#riskNumbersTable td.te-units .cell,
#riskNumbersTable td.te-units .value{
  white-space: inherit !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
  overflow-wrap: inherit !important;
  word-break: inherit !important;
}