/* Aestar docs — /docs/*, generated by site/docs.mjs.
   Loads after /css/aestar.css and reuses its tokens, type scale and palette.
   Dark mode re-points the neutral tokens only: the site header and footer are
   navy in both themes, so flipping the neutrals flips the reading surface. */

:root {
  --docs-side: 258px;
  --docs-rail: 208px;
  --docs-gap: 40px;
  --docs-head: 68px;
  --docs-card: var(--white);
  --docs-sunken: var(--paper);
  --docs-code: #f2f5fa;
  --docs-shadow: 0 24px 48px -30px rgba(7, 15, 31, 0.5);
}

:root[data-docs-theme="dark"] {
  --ink: #e8eef7;
  --slate: #b2c0d2;
  --mute: #8c9cb1;
  --line: #22304a;
  --paper: #0d1730;
  --white: #0a1128;
  --orange-soft: #2a1608;
  --orange-deep: #ff9a5c;
  --green-soft: #0c2b20;
  --amber-soft: #2b2006;
  --docs-card: #0e1834;
  --docs-sunken: #0a132a;
  --docs-code: #0a132a;
  --docs-shadow: 0 24px 48px -30px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

:root[data-docs-theme="dark"] body {
  background: #070f1f;
}

/* Layout ------------------------------------------------------------------ */

.docs-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding-inline: 24px;
}

.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-side) minmax(0, 1fr) var(--docs-rail);
  gap: var(--docs-gap);
  align-items: start;
  padding-block: 28px 72px;
}

/* "auto" is the default: nav shows on wide screens, hides on phones.
   An explicit choice from the toggle wins everywhere and is remembered. */
@media (max-width: 1099px) {
  :root[data-docs-nav="auto"] .docs-side {
    display: none;
  }
}
:root[data-docs-nav="hidden"] .docs-side {
  display: none;
}
@media (min-width: 1100px) {
  :root[data-docs-nav="hidden"] .docs-shell {
    grid-template-columns: minmax(0, 1fr) var(--docs-rail);
  }
}

/* Toolbar ----------------------------------------------------------------- */

.docs-bar {
  position: sticky;
  top: var(--docs-head);
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.docs-bar .docs-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  flex-wrap: wrap;
  padding-block: 8px;
}
.docs-bar-title {
  font: 700 13px/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-right: auto;
}
.docs-bar-title a {
  text-decoration: none;
  color: inherit;
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--docs-card);
  color: var(--ink);
  font: 550 14.5px/1 var(--body);
  cursor: pointer;
  white-space: nowrap;
}
.docs-btn:hover {
  border-color: var(--orange);
}
.docs-btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.docs-search-open {
  min-width: 190px;
  justify-content: flex-start;
  color: var(--mute);
}
.docs-kbd {
  margin-left: auto;
  font: 600 11.5px/1 var(--mono);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  color: var(--mute);
}

/* The toggle says "Hide navigation" where there is a sidebar to hide, and
   "Browse docs" on a phone where the same control reveals it. */
.docs-nav-toggle .on-wide {
  display: none;
}
@media (min-width: 1100px) {
  .docs-nav-toggle .on-wide {
    display: inline;
  }
  .docs-nav-toggle .on-narrow {
    display: none;
  }
}

/* Sidebar ----------------------------------------------------------------- */

.docs-side {
  position: sticky;
  top: calc(var(--docs-head) + 74px);
  max-height: calc(100vh - var(--docs-head) - 96px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-side h2 {
  font: 700 12px/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 24px 0 8px;
}
.docs-side h2:first-child {
  margin-top: 0;
}
.docs-side ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1px;
}
.docs-side a {
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--slate);
  font: 500 15px/1.4 var(--body);
  border-left: 2px solid transparent;
}
.docs-side a:hover {
  background: var(--docs-sunken);
  color: var(--ink);
}
.docs-side a[aria-current="page"] {
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-weight: 650;
  border-left-color: var(--orange);
}

@media (max-width: 1099px) {
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .docs-side {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px;
    background: var(--docs-card);
  }
}

/* Article ----------------------------------------------------------------- */

.docs-main {
  min-width: 0;
}
.docs-crumbs {
  font: 500 13.5px/1.4 var(--body);
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.docs-crumbs a {
  color: inherit;
  text-decoration: none;
}
.docs-crumbs a:hover {
  color: var(--orange-deep);
}

.docs-main h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.docs-lede {
  margin-top: 12px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--slate);
  max-width: 62ch;
  text-wrap: pretty;
}

.docs-body {
  margin-top: 36px;
  max-width: 74ch;
}
.docs-body h2 {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 46px 0 12px;
  scroll-margin-top: calc(var(--docs-head) + 76px);
}
.docs-body h3 {
  font-family: var(--display);
  font-size: 19px;
  margin: 28px 0 8px;
  scroll-margin-top: calc(var(--docs-head) + 76px);
}
.docs-body p,
.docs-body li {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.7;
}
.docs-body p + p {
  margin-top: 14px;
}
.docs-body ul,
.docs-body ol {
  padding-left: 22px;
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}
.docs-body strong {
  color: var(--ink);
  font-weight: 650;
}
.docs-body a:not(.docs-card):not(.btn) {
  color: var(--orange-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.docs-note {
  margin-top: 22px;
  background: var(--docs-sunken);
  border-left: 4px solid var(--orange);
  border-radius: 0 12px 12px 0;
  padding: 16px 18px;
}
.docs-note p {
  font-size: 16px;
}
.docs-note b {
  color: var(--ink);
}

.docs-code {
  margin-top: 16px;
  background: var(--docs-code);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow-x: auto;
  font: 500 13.5px/1.6 var(--mono);
  color: var(--ink);
  white-space: pre;
}

.docs-steps {
  counter-reset: docs-step;
  list-style: none;
  padding: 0;
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.docs-steps li {
  counter-increment: docs-step;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.docs-steps li::before {
  content: counter(docs-step);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font: 700 14px/30px var(--body);
  text-align: center;
}
.docs-steps b {
  display: block;
  color: var(--ink);
  font-size: 16.5px;
}

/* Cards ------------------------------------------------------------------- */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
a.docs-card {
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--docs-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
}
a.docs-card:hover {
  border-color: var(--orange);
  box-shadow: var(--docs-shadow);
}
a.docs-card b {
  font: 700 17px/1.3 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
a.docs-card span {
  color: var(--slate);
  font-size: 15px;
  line-height: 1.55;
}

/* Status pills ------------------------------------------------------------ */

.docs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font: 650 12px/1.2 var(--body);
  white-space: nowrap;
}
.docs-pill-live {
  background: var(--green-soft);
  color: #0b6443;
}
.docs-pill-next {
  background: var(--amber-soft);
  color: #6d4700;
}
.docs-pill-later {
  background: var(--docs-sunken);
  color: var(--mute);
  border: 1px solid var(--line);
}
:root[data-docs-theme="dark"] .docs-pill-live {
  color: #6fe0b2;
}
:root[data-docs-theme="dark"] .docs-pill-next {
  color: #f0c069;
}

.docs-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--docs-card);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
.docs-table th,
.docs-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--slate);
}
.docs-table tr:last-child td {
  border-bottom: 0;
}
.docs-table th {
  font: 700 12px/1.2 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  background: var(--docs-sunken);
}
.docs-table td:first-child {
  font-weight: 650;
  color: var(--ink);
}

/* Changelog --------------------------------------------------------------- */

.docs-day {
  margin-top: 34px;
  display: grid;
  gap: 10px;
}
.docs-day > h2 {
  margin: 0;
  font-size: 20px;
  scroll-margin-top: calc(var(--docs-head) + 76px);
}
.docs-day ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  border-left: 2px solid var(--line);
  padding-left: 18px;
}
.docs-day li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 16.5px;
}
.docs-pr {
  font: 600 12.5px/1 var(--mono);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--mute);
  text-decoration: none;
  flex: none;
}
.docs-pr:hover {
  border-color: var(--orange);
  color: var(--orange-deep);
}

/* On this page ------------------------------------------------------------ */

.docs-rail {
  position: sticky;
  top: calc(var(--docs-head) + 74px);
  max-height: calc(100vh - var(--docs-head) - 96px);
  overflow-y: auto;
  font-size: 14px;
}
.docs-rail summary {
  font: 700 12px/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 10px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.docs-rail summary::-webkit-details-marker {
  display: none;
}
.docs-rail summary::after {
  content: "+";
  font: 400 18px/1 var(--body);
}
.docs-rail[open] summary::after,
.docs-rail-box[open] > summary::after {
  content: "\2013";
}
@media (min-width: 1100px) {
  /* Wide screens always show the list, so the summary is just a heading. */
  .docs-rail summary {
    cursor: default;
    pointer-events: none;
  }
  .docs-rail summary::after {
    content: "";
  }
}
.docs-rail ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
}
.docs-rail .sub a {
  padding-left: 22px;
  font-size: 13.5px;
}
.docs-rail a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--mute);
  text-decoration: none;
  line-height: 1.45;
}
.docs-rail a:hover,
.docs-rail a.is-active {
  color: var(--orange-deep);
  background: var(--docs-sunken);
}
@media (max-width: 1099px) {
  .docs-rail {
    position: static;
    max-height: none;
    order: -1;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 18px;
    background: var(--docs-card);
  }
}

/* Ask Ava ----------------------------------------------------------------- */

.docs-ask {
  margin-top: 56px;
  background: var(--docs-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.docs-ask h2 {
  margin: 0;
  font: 700 19px/1.3 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.docs-ask p {
  margin-top: 6px;
  color: var(--slate);
  font-size: 15.5px;
}
.docs-ask form {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.docs-ask input {
  flex: 1 1 240px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--docs-card);
  color: var(--ink);
}
.docs-ask input::placeholder {
  color: var(--mute);
}

/* Prev / next ------------------------------------------------------------- */

.docs-updown {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.docs-updown a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  text-decoration: none;
  background: var(--docs-card);
}
.docs-updown a:hover {
  border-color: var(--orange);
}
.docs-updown small {
  color: var(--mute);
  font: 650 12px/1.2 var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.docs-updown b {
  color: var(--ink);
  font: 650 16.5px/1.35 var(--body);
}
.docs-updown .next {
  text-align: right;
}

.docs-stamp {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Search dialog ----------------------------------------------------------- */

.docs-finder {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--docs-card);
  color: var(--ink);
  box-shadow: var(--docs-shadow);
  margin-top: 8vh;
}
.docs-finder::backdrop {
  background: rgba(7, 15, 31, 0.55);
}
.docs-finder-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.docs-finder input {
  flex: 1;
  min-height: 42px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 17px;
  outline: none;
}
.docs-finder ul {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: min(58vh, 440px);
  overflow-y: auto;
  display: grid;
  gap: 2px;
}
.docs-finder li a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.docs-finder li a:hover,
.docs-finder li[aria-selected="true"] a {
  background: var(--orange-soft);
}
.docs-finder li b {
  font: 650 15.5px/1.35 var(--body);
  color: var(--ink);
}
.docs-finder li small {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.45;
}
.docs-finder-empty {
  padding: 22px 16px;
  color: var(--mute);
  font-size: 15px;
}
.docs-finder-foot {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  color: var(--mute);
  font-size: 12.5px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .docs-wrap {
    padding-inline: 16px;
  }
  .docs-bar-title {
    width: 100%;
    margin-bottom: 2px;
  }
  .docs-search-open {
    flex: 1 1 auto;
    min-width: 0;
  }
  .docs-body {
    margin-top: 28px;
  }
  .docs-updown .next {
    text-align: left;
  }
}

/* The site header and footer are painted for the light marketing site. In
   dark docs they sit on a dark page, so their ink has to come with us. */
:root[data-docs-theme="dark"] .site-head,
:root[data-docs-theme="dark"] .site-head .logo,
:root[data-docs-theme="dark"] .site-head .nav > a,
:root[data-docs-theme="dark"] .site-head .nav-item > button,
:root[data-docs-theme="dark"] .menu-toggle,
:root[data-docs-theme="dark"] .mobile-nav a,
:root[data-docs-theme="dark"] .mobile-nav h4,
:root[data-docs-theme="dark"] .site-foot,
:root[data-docs-theme="dark"] .site-foot h4,
:root[data-docs-theme="dark"] .site-foot a,
:root[data-docs-theme="dark"] .menu-link b {
  color: var(--ink);
}
:root[data-docs-theme="dark"] .mobile-nav,
:root[data-docs-theme="dark"] .menu-panel {
  background: var(--docs-card);
  border-color: var(--line);
}
:root[data-docs-theme="dark"] .menu-link span span,
:root[data-docs-theme="dark"] .site-foot p,
:root[data-docs-theme="dark"] .foot-legal {
  color: var(--slate);
}
:root[data-docs-theme="dark"] .site-foot {
  background: #060d1c;
  border-top-color: var(--line);
}
