/* Atlas software documentation (/software/documentation/atlasofliegroups-docs/).
   Generated pages: see tools/port_docs.py. Uses only the tokens defined in /style.css. */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- layout ---------- */

.docs { padding-block: clamp(1.5rem, 4vw, 3rem); }
.docs-skip { display: none; font-size: var(--step--1); margin-bottom: 1rem; }

.docs-layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.docs-nav { grid-column: 1; grid-row: 1; }
.doc { grid-column: 2; grid-row: 1; min-width: 0; }

/* ---------- sidebar ---------- */

.docs-nav {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: var(--step--1);
  line-height: 1.4;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}
.docs-search input,
.search-row input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
}
.docs-search input:focus, .search-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.docs-home { margin: 1rem 0 0.5rem; font-weight: 600; }
.docs-single { margin: 0.25rem 0 0.5rem; font-weight: 600; }
.docs-single a[aria-current="page"] { color: var(--accent); }
.docs-nav a { color: var(--ink); text-decoration: none; }
.docs-nav a:hover { color: var(--accent); text-decoration: underline; }
.docs-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.docs-nav details { border-top: 1px solid var(--rule); }
.docs-nav summary {
  cursor: pointer;
  padding: 0.55rem 0;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.docs-nav summary::-webkit-details-marker { display: none; }
.docs-nav summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.docs-nav details[open] > summary::after { content: "−"; }
.docs-nav summary:hover { color: var(--accent); }
.docs-nav details[open] > summary { color: var(--accent); }
.docs-nav ul { list-style: none; margin: 0; padding: 0 0 0.6rem; }
.docs-nav ul ul { padding: 0.25rem 0 0.25rem 0.8rem; border-left: 1px solid var(--rule); margin: 0.25rem 0 0.25rem 0.15rem; }
.docs-nav li { padding: 0.2rem 0; }
.docs-nav li.current > a { font-weight: 600; }
.docs-nav .overview a { color: var(--muted); }

/* ---------- article ---------- */

.doc { font-size: var(--step-0); }
.doc > :first-child { margin-top: 0; }
.doc h1 { margin: 0.35rem 0 1.25rem; overflow-wrap: anywhere; }
.doc h2 { margin: 2.25rem 0 0.75rem; overflow-wrap: anywhere; }
.doc h3 { margin: 1.75rem 0 0.6rem; overflow-wrap: anywhere; }
.doc h4 { font-family: var(--sans); font-size: var(--step-0); margin: 1.5rem 0 0.5rem; }
.doc p, .doc ul, .doc ol, .doc dl, .doc pre, .doc table, .doc blockquote,
.doc .callout, .doc .line-block, .doc iframe, .doc .fn-entry { margin-top: 0; margin-bottom: 1rem; }
.doc :is(p, li, dd, td, .callout) { max-width: 78ch; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li > ul, .doc li > ol { margin-bottom: 0.25rem; }
.doc li + li { margin-top: 0.2rem; }
.doc dt { font-weight: 600; }
.doc dd { margin: 0 0 0.75rem 1.25rem; }
.doc blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--rule); }
.doc img { display: block; }
.doc .align-center { margin-inline: auto; }
.doc .eyebrow { margin: 0; }
.doc .lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); }
.doc .section-intro { color: var(--muted); margin-bottom: 1rem; max-width: 78ch; }
.doc section:target > :first-child, .doc [id]:target { scroll-margin-top: 1rem; }

.doc .line-block .line { min-height: 1em; }

/* code */
.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
}
.doc pre {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: 3px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.doc :is(h1, h2, h3, h4, td, th, .fn-sig) code { background: none; border: 0; padding: 0; font-size: 0.95em; }
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.doc .atlas-prompt, .doc .shell-prompt { color: var(--accent); }
.doc .atlas-output, .doc .shell-output { color: var(--muted); }
.doc .atlas-comment { color: var(--muted); font-style: italic; }
.doc .code-label {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: var(--step--1); color: var(--muted);
  margin: 1.25rem 0 -1px; padding: 0.25rem 0.75rem;
  border: 1px solid var(--rule); border-bottom: 0; border-radius: 3px 3px 0 0;
}
.doc .code-label + pre { border-top-left-radius: 0; border-top-right-radius: 0; }
.doc .lang-tag { font-family: var(--mono); }

/* callouts (Sphinx admonitions and the new pages' notes) */
.doc .callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 3px 3px 0;
}
.doc .callout > :last-child { margin-bottom: 0; }
.doc .callout-title {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.35rem;
}
.doc .callout.tip { border-left-color: var(--link); }
.doc .callout.tip .callout-title { color: var(--link); }

/* tables */
.doc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--rule); }
.doc th { font-weight: 600; color: var(--muted); border-bottom-color: var(--ink); }
.doc td + td, .doc th + th { padding-left: 0.75rem; }
.doc table.tt td:first-child, .doc table.conv td:first-child, .doc table.prec td:first-child {
  font-family: var(--mono); white-space: nowrap;
}

/* function reference entries (built-in functions page) */
.doc .fn-entry { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.doc .fn-sig { font-family: var(--mono); font-size: 0.88rem; overflow-wrap: anywhere; }
.doc .fn-name { font-weight: 600; color: var(--ink); }
.doc .fn-type { color: var(--muted); }
.doc .fn-desc { margin: 0.2rem 0 0; }

/* script pages */
.doc .file-meta {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem;
  font-size: var(--step--1); padding: 0.75rem 0; border-block: 1px solid var(--rule);
}
.doc .file-meta dt { color: var(--muted); font-weight: 500; }
.doc .file-meta dd { margin: 0; }
.doc .dep-badge {
  display: inline-block; font-family: var(--mono); font-size: 0.8rem;
  border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.4rem; margin: 0 0.35rem 0.3rem 0;
  text-decoration: none;
}

/* index page */
.doc .def-list { margin-bottom: 1.5rem; }
.doc .def-item { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.doc .def-term { font-family: var(--serif); font-size: var(--step-1); }
.doc .def-term a { text-decoration: none; }
.doc .def-desc { margin: 0.2rem 0 0; color: var(--muted); }
.doc .contents-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem 2.5rem;
}
.doc .contents-grid h3 { margin-top: 1rem; font-size: var(--step-1); }
.doc .contents-grid h3 a { text-decoration: none; }
.doc .contents-grid ul { list-style: none; padding: 0; font-size: var(--step--1); }
.doc .contents-grid ul ul { padding-left: 0.9rem; margin: 0.2rem 0; }

.doc .platform-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; font-weight: 600; }

/* in-page table of contents (new pages) */
.doc .page-toc {
  border: 1px solid var(--rule); border-radius: 3px; background: var(--surface);
  padding: 0.75rem 1rem; margin: 0 0 1.5rem; font-size: var(--step--1);
}
.doc .page-toc-title { font-weight: 600; color: var(--muted); margin-bottom: 0.35rem; }
.doc .page-toc ul { list-style: none; padding: 0; margin: 0; columns: 2 14rem; column-gap: 2rem; }
.doc .page-toc li { margin: 0 0 0.15rem; break-inside: avoid; }
.doc .page-toc .toc-sub { padding-left: 0.9rem; }

/* video embeds */
.doc iframe { display: block; width: 100%; max-width: 560px; height: auto; aspect-ratio: 16 / 9; border: 0; }

/* math */
.doc mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; }

/* previous / next */
.page-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule);
}
.page-nav a { display: grid; gap: 0.1rem; text-decoration: none; max-width: 48%; }
.page-nav a span { font-size: var(--step--1); color: var(--muted); }
.page-nav a.next { margin-left: auto; text-align: right; }

/* search page */
.search-page { margin: 1rem 0; max-width: 40rem; }
.search-page label { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 0.35rem; }
.search-row { display: flex; gap: 0.5rem; }
.search-row .button { background: none; cursor: pointer; font-family: var(--sans); }
.search-status { color: var(--muted); font-size: var(--step--1); }
.doc .search-results { padding-left: 1.4rem; }
.doc .search-results li { margin-bottom: 0.9rem; }
.doc .search-results a { font-weight: 600; }
.doc .search-results .search-section { margin-left: 0.6rem; font-size: var(--step--1); color: var(--muted); }
.doc .search-results p { margin: 0.1rem 0 0; font-size: var(--step--1); color: var(--muted); overflow-wrap: anywhere; }

/* ---------- narrow screens: article first, contents after ---------- */

@media (max-width: 900px) {
  .docs-skip { display: block; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .doc, .docs-nav { grid-column: 1; grid-row: auto; }
  .docs-nav {
    position: static; max-height: none; overflow: visible; padding: 1.5rem 0 0;
    border-top: 1px solid var(--ink); margin-top: 1rem;
  }
  .page-nav a { max-width: none; }
}
.docs-nav summary .summary-link { color: inherit; text-decoration: none; flex: 1; }
.docs-nav summary .summary-link:hover { color: var(--accent); }
.docs-nav summary .summary-link[aria-current="page"] { color: var(--accent); }

/* ---------- script reference (generated by tools/gen_script_reference.py) ---------- */
.doc pre.sr-comment {
  white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible;
  font-size: 0.82rem; line-height: 1.45; color: var(--ink);
  background: none; border: 0; border-left: 2px solid var(--rule); border-radius: 0;
  padding: 0.05rem 0 0.05rem 0.75rem; margin: 0.4rem 0 0;
}
.doc .sr-header { margin: 1rem 0 1.25rem; }
.doc .sr-header pre.sr-comment { font-size: 0.9rem; border-left-color: var(--accent); padding: 0.2rem 0 0.2rem 1rem; }
.doc .sr-loads { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 0.35rem; }
.doc .sr-loads li { margin: 0; }
.doc .sr-incnote { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-right: 0.6rem; }
.doc .dep-badge.sr-ext { color: var(--muted); border-style: dashed; }
.doc .sr-defs-head { margin-top: 2rem; }
.doc .sr-defs-head span, .doc .sr-section .sr-line { font-family: var(--sans); font-size: var(--step--1); font-weight: 400; color: var(--muted); }
.doc .sr-section { margin-top: 2.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--ink); }
.doc .sr-def { padding: 0.75rem 0 0.85rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.doc .sr-def h3 { font-size: var(--step-0); margin: 0 0 0.3rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.doc .sr-def h3 code { font-size: 1rem; font-weight: 600; }
.doc .sr-kind, .doc .sr-generic {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.35rem;
}
.doc .sr-sig { display: flex; align-items: baseline; gap: 0.3rem 0.6rem; margin-top: 0.45rem; scroll-margin-top: 1rem; }
.doc .sr-sig:target { background: var(--surface); }
.doc .sr-sig > code { order: 1; flex: 1 1 auto; min-width: 0; font-size: 0.86rem; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.doc .sr-sig > .sr-generic { order: 2; white-space: nowrap; }
.doc .sr-sig > pre.sr-code { order: 1; flex: 1 1 auto; min-width: 0; margin: 0; }
.doc .sr-line { order: 3; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.doc .sr-line:hover { color: var(--accent); }
.doc .sr-fields { font-size: var(--step--1); color: var(--muted); margin: 0.35rem 0 0; }
.doc .sr-also { font-size: var(--step--1); color: var(--muted); margin: 0.45rem 0 0; }
.doc .sr-note { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.doc .sr-note pre.sr-comment { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--muted); }
.doc .sr-rule { border: 0; border-top: 1px solid var(--ink); margin: 1.5rem 0 0; }
.doc .sr-commented { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.doc .sr-commented summary { color: var(--muted); cursor: pointer; }
.doc .sr-commented pre { margin: 0.5rem 0 0; }
.doc .sr-generated { margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }
.doc .sr-num { text-align: right; font-variant-numeric: tabular-nums; }
.doc table.sr-files td:first-child { white-space: nowrap; }
.doc table.sr-files td:first-child a { text-decoration: none; }
/* function index */
.doc .sr-jump { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 1.25rem 0 0.75rem; font-family: var(--mono); font-size: 0.9rem; }
.doc .sr-jump a, .doc .sr-jump span { min-width: 2rem; text-align: center; padding: 0.15rem 0.3rem; border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; }
.doc .sr-jump span { color: var(--muted); border-style: dashed; }
.doc .sr-jump a:hover { border-color: var(--accent); }
.doc .sr-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 1rem; font-size: var(--step--1); }
.doc .sr-filter label { color: var(--muted); }
.doc .sr-filter input {
  font: inherit; font-family: var(--mono); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.3rem 0.5rem; width: min(100%, 18rem);
}
.doc .sr-filter input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.doc #sr-qn { color: var(--muted); }
.doc .sr-letter { scroll-margin-top: 1rem; }
.doc .sr-letter h2 { margin-top: 1.75rem; border-bottom: 1px solid var(--ink); padding-bottom: 0.2rem; }
.doc .sr-index { list-style: none; padding: 0; margin: 0.5rem 0 0; columns: 2 22rem; column-gap: 2.5rem; font-size: var(--step--1); }
.doc .sr-index li { break-inside: avoid; padding: 0.2rem 0; margin: 0; overflow-wrap: anywhere; }
.doc .sr-index li > code { font-weight: 600; background: none; border: 0; padding: 0; }
.doc .sr-locs { color: var(--muted); }
.doc .sr-locs a { text-decoration: none; }
.doc .sr-locs a:hover { text-decoration: underline; }
.doc .sr-count { color: var(--muted); }
.docs-nav ul ul a { overflow-wrap: anywhere; }
