/* OmsiLaunch documentation pages. Loaded after style.css; reuses its tokens. */

.docs-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 232px;
  gap: 48px;
  align-items: start;
  padding: 40px 0 96px;
}

/* ---------- Sidebar ---------- */
.docs-nav-toggle { display: none; }
.docs-sidebar {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.docs-search { position: relative; margin-bottom: 22px; }
.docs-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.docs-search input::placeholder { color: var(--dim); }
.docs-search input:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: transparent; }
.docs-search-results {
  position: absolute;
  z-index: 20;
  left: 0; right: 0; top: 48px;
  margin: 0; padding: 6px;
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.docs-search-results a { display: block; padding: 9px 10px; border-radius: 6px; }
.docs-search-results a:hover,
.docs-search-results a:focus-visible,
.docs-search-results li.is-selected a { background: rgba(255,153,24,.12); outline: none; }
.docs-search-results strong { display: block; font-size: 14px; color: var(--text); }
.docs-search-results em { display: block; font-style: normal; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-2); font-family: var(--display); }
.docs-search-results small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.docs-search-results mark { background: none; color: var(--amber-2); font-weight: 700; }
.docs-search-results .empty { padding: 10px; color: var(--muted); font-size: 14px; }

.docs-nav-title {
  margin: 24px 0 8px;
  color: var(--dim);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.docs-sidebar ul { margin: 0; padding: 0; list-style: none; }
.docs-sidebar li a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line-soft);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.35;
  transition: color .12s, border-color .12s, background .12s;
}
.docs-sidebar li a:hover { color: var(--text); border-left-color: var(--dim); }
.docs-sidebar li a[aria-current="page"] {
  color: var(--amber-2);
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(255,153,24,.10), transparent);
  font-weight: 600;
}
.docs-nav-root li a { font-weight: 600; color: #dce3e7; }

/* ---------- Main column ---------- */
.docs-main { min-width: 0; }
.docs-breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 18px;
  color: var(--dim);
  font-size: 13px;
}
.docs-breadcrumbs a:hover { color: var(--amber-2); }
.docs-breadcrumbs i { font-style: normal; opacity: .6; }
.docs-breadcrumbs [aria-current] { color: var(--muted); }

.docs-article { max-width: 860px; }
.docs-article h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.docs-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin: 0 0 30px; padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
.docs-meta strong { color: var(--muted); font-weight: 600; }
.docs-meta a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.docs-meta a:hover { color: var(--amber-2); }
.docs-meta svg { width: 15px; height: 15px; fill: currentColor; }
.docs-notice {
  padding: 12px 16px; margin: 0 0 24px;
  border: 1px solid rgba(255,153,24,.35); border-radius: 8px;
  background: rgba(255,153,24,.08); color: var(--amber-2); font-size: 14px;
}

.docs-article h2, .docs-article h3, .docs-article h4 { position: relative; scroll-margin-top: 100px; font-family: var(--display); line-height: 1.22; }
.docs-article h2 { margin: 52px 0 16px; padding-top: 28px; border-top: 1px solid var(--line-soft); font-size: 27px; }
.docs-article h3 { margin: 34px 0 12px; font-size: 20.5px; }
.docs-article h4 { margin: 26px 0 10px; font-size: 17px; color: #dce3e7; }
.docs-article .anchor {
  margin-left: 10px; color: var(--amber); opacity: 0; text-decoration: none;
  font-weight: 400; transition: opacity .12s;
}
.docs-article :is(h2, h3, h4):hover .anchor,
.docs-article .anchor:focus-visible { opacity: .85; }
.docs-article .alias { position: absolute; }

.docs-article p, .docs-article li { color: #d3dce1; line-height: 1.72; font-size: 16px; }
.docs-article p { margin: 0 0 16px; }
.docs-article ul, .docs-article ol { margin: 0 0 18px; padding-left: 24px; }
.docs-article li { margin: 5px 0; }
.docs-article li > ul, .docs-article li > ol { margin: 6px 0 8px; }
.docs-article a:not(.anchor) { color: var(--amber-2); text-decoration: underline; text-decoration-color: rgba(255,176,42,.35); text-underline-offset: 3px; }
.docs-article a:not(.anchor):hover { text-decoration-color: var(--amber-2); }
.docs-article hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.docs-article img { border-radius: 8px; border: 1px solid var(--line); margin: 18px 0; }

.docs-article code {
  display: inline;            /* style.css sets a global code{display:block;padding:16px} */
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: #ffd9a1;
  font: 13.5px/1.4 Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  overflow-wrap: anywhere;
}
.docs-article kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); font-size: 13px; }

/* stability vocabulary chips (STABLE_BETA, EXPERIMENTAL, ...) */
.docs-article code.badge {
  padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.badge-stable { color: var(--green) !important; border-color: rgba(67,200,111,.45) !important; background: rgba(67,200,111,.10) !important; }
.badge-experimental { color: #ffb02a !important; border-color: rgba(255,176,42,.5) !important; background: rgba(255,176,42,.10) !important; }
.badge-partial { color: #7cc4ff !important; border-color: rgba(124,196,255,.45) !important; background: rgba(124,196,255,.10) !important; }
.badge-internal { color: #b8a6ff !important; border-color: rgba(184,166,255,.45) !important; background: rgba(184,166,255,.10) !important; }
.badge-unavailable { color: #ff7b72 !important; border-color: rgba(255,123,114,.45) !important; background: rgba(255,123,114,.10) !important; }

.code-block { position: relative; margin: 0 0 22px; }
.code-block pre {
  margin: 0; padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-dark);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.docs-article .code-block pre code { display: block; padding: 0; border: 0; background: none; color: #dfe7eb; font-size: 13.5px; line-height: 1.6; overflow-wrap: normal; white-space: pre; }
.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute; left: 14px; top: -10px; z-index: 1;
  padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--dim);
  font: 700 10.5px/1.6 var(--display); letter-spacing: .1em; text-transform: uppercase;
}
.code-copy {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--muted);
  font-size: 12px; cursor: pointer;
  opacity: 0; transition: opacity .12s, color .12s;
}
.code-block:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--amber-2); }
.code-copy.is-done { color: var(--green); opacity: 1; }

.table-wrap {
  margin: 0 0 24px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.docs-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.docs-article th {
  padding: 11px 14px; text-align: left; white-space: nowrap;
  background: var(--panel-2); color: #dce3e7;
  font: 700 12.5px/1.3 var(--display); letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.docs-article td { padding: 11px 14px; vertical-align: top; color: #cbd5da; line-height: 1.55; border-bottom: 1px solid var(--line-soft); min-width: 120px; }
.docs-article tr:last-child td { border-bottom: 0; }
.docs-article tbody tr:hover td { background: rgba(255,255,255,.02); }
.docs-article td p, .docs-article td li { font-size: inherit; }

.docs-article blockquote {
  margin: 0 0 20px; padding: 12px 18px;
  border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0;
  background: rgba(255,153,24,.06);
}
.docs-article blockquote p { margin: 0; color: #cfd8dd; font-size: 15px; }
.docs-article blockquote p + p { margin-top: 10px; }

/* ---------- Previous / next ---------- */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 860px; margin-top: 56px; }
.docs-pager a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  transition: border-color .15s, background .15s;
}
.docs-pager a:hover { border-color: var(--amber); background: var(--panel-2); }
.docs-pager span { color: var(--dim); font: 700 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.docs-pager strong { color: var(--text); font-size: 16px; }
.docs-pager .next { text-align: right; grid-column: 2; }
.docs-pager .prev { grid-column: 1; }
.docs-pager .prev span::before { content: "← "; }
.docs-pager .next span::after { content: " →"; }

/* ---------- On this page ---------- */
.docs-toc { position: sticky; top: 98px; max-height: calc(100vh - 118px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.docs-toc-title { margin: 0 0 10px; color: var(--dim); font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.docs-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.docs-toc a { display: block; margin-left: -1px; padding: 5px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.docs-toc .l3 a { padding-left: 26px; font-size: 13px; color: var(--dim); }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: var(--amber-2); border-left-color: var(--amber); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 36px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 22px; }
  .docs-nav-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 46px; padding: 0 16px; margin-bottom: 14px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel); font-weight: 600; cursor: pointer;
  }
  .docs-nav-toggle::after { content: "▾"; color: var(--amber); transition: transform .15s; }
  .docs-nav-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .docs-sidebar {
    display: none; position: static; max-height: none;
    margin-bottom: 26px; padding: 14px; overflow: visible;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  }
  .docs-sidebar.is-open { display: block; }
  .docs-article h2 { font-size: 23px; margin-top: 40px; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .next, .docs-pager .prev { grid-column: 1; text-align: left; }
  .docs-article .anchor { opacity: .5; }
}
@media (prefers-reduced-motion: reduce) { .docs-page * { transition: none !important; } }
