/* OSA documentation pages (/openstock/docs/): how to read the SIP, TAM and FAM pages.
   Built on the site tokens in css/osa_all_pages.css, so light and dark mode follow the site. */

.osa-docs { max-width: 82ch; }
.osa-docs h2 { font-size: 21px; margin: 40px 0 12px; scroll-margin-top: calc(var(--osa-topbar-h) + 12px); }
.osa-docs h3 { font-size: 16.5px; margin: 26px 0 8px; scroll-margin-top: calc(var(--osa-topbar-h) + 12px); }
.osa-docs p, .osa-docs li { color: var(--osa-text-2); line-height: 1.65; }
.osa-docs ul, .osa-docs ol { padding-left: 22px; }
.osa-docs li { margin-bottom: 6px; }
.osa-docs strong { color: var(--osa-text); }
.osa-docs code { font-size: 13px; padding: 1px 5px; border-radius: 5px; background: var(--osa-surface-2); color: var(--osa-text); }

/* "On this page" contents box */
.osa-doc-toc {
  margin: 0 0 28px; padding: 16px 20px; max-width: 82ch;
  background: var(--osa-surface); border: 1px solid var(--osa-border); border-radius: var(--osa-radius);
}
.osa-doc-toc-title { margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--osa-muted); }
.osa-doc-toc ol { margin: 0; padding-left: 20px; columns: 2 220px; column-gap: 28px; }
.osa-doc-toc li { margin: 0 0 4px; font-size: 14.5px; break-inside: avoid; }

/* Tables: wide ones scroll sideways inside their own box on phones, never the page */
.osa-doc-table-wrap { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--osa-border); border-radius: var(--osa-radius-sm); }
.osa-doc-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--osa-surface); }
.osa-doc-table th, .osa-doc-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--osa-border); }
.osa-doc-table th { background: var(--osa-surface-2); color: var(--osa-text); font-weight: 650; white-space: nowrap; }
.osa-doc-table td { color: var(--osa-text-2); }
.osa-doc-table tr:last-child td { border-bottom: 0; }
.osa-doc-table td.osa-num, .osa-doc-table th.osa-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.osa-doc-table td:first-child { color: var(--osa-text); font-weight: 600; }
.osa-doc-table tfoot td { background: var(--osa-surface-2); font-weight: 600; color: var(--osa-text); }

/* Callouts: tip (green), caution (orange), rule (blue) */
.osa-doc-callout {
  margin: 16px 0; padding: 12px 16px; border-radius: var(--osa-radius-sm);
  border: 1px solid; border-left-width: 4px; font-size: 14.5px; line-height: 1.6;
}
.osa-doc-callout p { margin: 0; color: inherit; }
.osa-doc-callout p + p { margin-top: 6px; }
.osa-doc-callout strong { color: inherit; }
.osa-doc-tip     { background: #eaf4ea; border-color: #bcdcbc; border-left-color: #4f9a55; color: #24572a; }
.osa-doc-caution { background: #fff2e0; border-color: #f6cf9c; border-left-color: #f0901e; color: #7a4200; }
.osa-doc-rule    { background: #e8f2fc; border-color: #b6d4f2; border-left-color: #4a90d9; color: #1f4f7f; }
[data-bs-theme="dark"] .osa-doc-tip     { background: #1c2f1e; border-color: #345a38; border-left-color: #6dbb73; color: #c4e4c6; }
[data-bs-theme="dark"] .osa-doc-caution { background: #3b2a14; border-color: #6e4c1f; border-left-color: #f0a04a; color: #f8d6a8; }
[data-bs-theme="dark"] .osa-doc-rule    { background: #172b40; border-color: #2c4d70; border-left-color: #6aa8e6; color: #c5def6; }

/* Small colored labels that match the badges on the model pages */
.osa-doc-pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  white-space: nowrap; background: var(--osa-surface-3); color: var(--osa-text);
}
.osa-doc-pill.osa-doc-buy  { background: #e2f1e3; color: #24572a; }
.osa-doc-pill.osa-doc-warn { background: #fdecd2; color: #7a4200; }
.osa-doc-pill.osa-doc-sell { background: #fbe1df; color: #7d2620; }
.osa-doc-pill.osa-doc-info { background: #e1edf9; color: #1f4f7f; }
[data-bs-theme="dark"] .osa-doc-pill.osa-doc-buy  { background: #24402a; color: #c4e4c6; }
[data-bs-theme="dark"] .osa-doc-pill.osa-doc-warn { background: #4a3417; color: #f8d6a8; }
[data-bs-theme="dark"] .osa-doc-pill.osa-doc-sell { background: #4a2522; color: #f6c4be; }
[data-bs-theme="dark"] .osa-doc-pill.osa-doc-info { background: #1d3550; color: #c5def6; }

/* Two side-by-side panels (full size vs scale in); stacked on phones */
.osa-doc-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 18px; }
.osa-doc-compare .osa-card { padding: 18px; }
.osa-doc-compare h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.osa-doc-compare ul { margin: 0; padding-left: 18px; }
.osa-doc-compare li { font-size: 14.5px; }

/* Price ladder diagram (inline SVG) */
.osa-doc-figure { margin: 14px 0 20px; padding: 16px; background: var(--osa-surface); border: 1px solid var(--osa-border); border-radius: var(--osa-radius); }
.osa-doc-figure svg { display: block; width: 100%; height: auto; max-width: 720px; margin: 0 auto; }
.osa-doc-figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--osa-muted); text-align: center; }
.osa-doc-figure .lad-axis { stroke: var(--osa-border-strong); stroke-width: 2; }
.osa-doc-figure .lad-line { stroke-width: 2; }
.osa-doc-figure .lad-sell { stroke: #4f9a55; }
.osa-doc-figure .lad-buy  { stroke: #4a90d9; }
.osa-doc-figure .lad-stop { stroke: #d9534f; }
.osa-doc-figure .lad-ref  { stroke: var(--osa-muted); stroke-dasharray: 5 4; }
.osa-doc-figure .lad-price { fill: var(--osa-text); font: 600 13px system-ui, sans-serif; }
.osa-doc-figure .lad-label { fill: var(--osa-text-2); font: 13px system-ui, sans-serif; }
.osa-doc-figure .lad-note  { fill: var(--osa-muted); font: 12px system-ui, sans-serif; }
.osa-doc-figure .lad-dot-buy  { fill: #4a90d9; }
.osa-doc-figure .lad-dot-sell { fill: #4f9a55; }
.osa-doc-figure .lad-path { fill: none; stroke: var(--osa-text-2); stroke-width: 2; stroke-linejoin: round; }

/* Guide cards on the overview page */
.osa-doc-cards { margin-top: 8px; }

@media (max-width: 640px) {
  .osa-docs h2 { font-size: 19px; }
  .osa-doc-toc ol { columns: 1; }
  .osa-doc-table { font-size: 13px; }
  .osa-doc-table th, .osa-doc-table td { padding: 7px 9px; }
}
.osa-docs .osa-muted { color: var(--osa-muted); }
