/* the documentation pages: the landing page's tokens (system.css), a side list, the text and an "on this page" list */
:root {
  --p-bg: #0c1018; --p-surface: #182234; --p-ink: #e8eef6; --p-muted: #9aa3b0;
  --p-accent: #2e80d6; --p-accent-ink: #0c1018; --p-action: #2e80d6; --p-action-ink: #0c1018;
  --p-inv-bg: #e8eef6; --p-inv-surface: #d6dce4; --p-inv-ink: #0c1018; --p-inv-muted: #555a63;
  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-text: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500; --display-tracking: -0.028em;
}
html { scroll-padding-top: 96px; }
body { background: var(--p-bg); color: var(--p-ink); }
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 48px; padding-top: calc(var(--nav, 72px) + 48px); padding-bottom: 96px; align-items: start; }
.docs--wide { grid-template-columns: minmax(0, 1fr) 200px; }
.docs__side, .docs__toc { position: sticky; top: calc(var(--nav, 72px) + 24px); max-height: calc(100vh - 120px); overflow: auto; font-size: 14px; }
.docs__side ul, .docs__toc ul { list-style: none; margin: 0 0 24px; padding: 0; }
.docs__side li a, .docs__toc li a { display: block; padding: 6px 0; color: var(--p-muted); text-decoration: none; line-height: 1.35; }
.docs__side li a:hover, .docs__toc li a:hover { color: var(--p-ink); }
.docs__side a[aria-current="page"] { color: var(--p-ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--p-accent); padding-inline-start: 10px; }
[dir="rtl"] .docs__side a[aria-current="page"] { box-shadow: inset -2px 0 0 var(--p-accent); }
.docs__side .t-label, .docs__toc .t-label { color: var(--p-muted); margin: 0 0 8px; font-size: 13px; font-weight: 500; }
.prose { min-width: 0; max-width: 820px; font-size: 16px; line-height: 1.7; }
.prose h1 { font: var(--display-weight) clamp(34px, 3vw + 12px, 48px)/1.1 var(--font-display); letter-spacing: var(--display-tracking); margin: 0 0 16px; }
.prose h2 { font: var(--display-weight) 28px/1.2 var(--font-display); letter-spacing: -0.02em; margin: 56px 0 16px; padding-top: 8px; }
.prose h3 { font: 500 20px/1.3 var(--font-display); margin: 36px 0 8px; }
.prose h4 { font: 500 16px/1.3 var(--font-display); margin: 24px 0 8px; }
.prose p, .prose li { color: var(--p-ink); }
.prose .lead { font-size: 20px; line-height: 1.55; color: var(--p-muted); margin-bottom: 32px; }
.prose a { color: #7ac8ff; text-underline-offset: 3px; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: #151d2b; border: 1px solid #222d40; border-radius: 4px; padding: 1px 5px; }
.prose pre { background: #0f1520; border: 1px solid #222d40; border-radius: 8px; padding: 16px 20px; overflow: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose .table { overflow-x: auto; margin: 16px 0 24px; }
.prose table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 14px; line-height: 1.5; }
.prose td:last-child { min-width: 240px; }
.prose .table { -webkit-overflow-scrolling: touch; }
.prose th, .prose td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid #222d40; }
.prose th { color: var(--p-muted); font-weight: 500; white-space: nowrap; }
.prose td code { white-space: nowrap; }
.prose td:last-child code { white-space: normal; }
.prose blockquote { margin: 16px 0; padding: 4px 20px; border-inline-start: 2px solid var(--p-accent); color: var(--p-muted); }
.prose .chips a { display: inline-block; margin: 0 6px 8px 0; padding: 4px 10px; border: 1px solid #263248; border-radius: 99px; font-size: 13px; text-decoration: none; color: var(--p-ink); }
.prose .chips a:hover { border-color: var(--p-accent); }
.prose .changes li { margin: 4px 0; }
.prose .mono { font-family: var(--font-mono); font-size: 13px; }
.prose .small { font-size: 13px; word-break: break-all; }
.prose .muted, .docs__foot .muted { color: var(--p-muted); }
.prose .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.prose .stats > div { display: grid; gap: 4px; }
.prose .t-stat { font: var(--display-weight) 38px/1 var(--font-display); letter-spacing: -0.02em; }
.prose .notices { white-space: pre-wrap; font-size: 12.5px; max-height: none; }
.prose .dl { border-top: 1px solid #222d40; padding-top: 8px; margin-top: 32px; }
.prose .btn { text-decoration: none; }
.docs__groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.docs__group h2 { margin-top: 24px; }
.docs__group ul { list-style: none; padding: 0; }
.docs__group li a { display: block; padding: 6px 0; }
.docs__foot { border-top: 1px solid #222d40; padding: 32px 0 48px; font-size: 14px; }
.docs__foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; }
.docs__foot a { color: var(--p-muted); }
.docs__foot .docs__tm { flex-basis: 100%; }
@media (max-width: 1199px) { .docs { grid-template-columns: 200px minmax(0, 1fr); } .docs__toc { display: none; } .docs--wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 799px) {
  .docs, .docs--wide { grid-template-columns: minmax(0, 1fr); padding-top: calc(var(--nav, 56px) + 32px); }
  .docs__side { position: static; max-height: none; display: none; }
  .prose .stats, .docs__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the phone menu (no script framework on these pages) */
@media (max-width: 1023px) {
  .nav__links { display: none; }
  html.docs-menu .nav__links { display: flex; position: fixed; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--p-bg); border-bottom: 1px solid #222d40; padding: 8px 24px 16px; z-index: 20; }
  html.docs-menu .nav__links .nav__link { display: block; padding: 14px 0; }
}
/* the platform tests: many narrow columns of one word each */
.prose .table--tests table { min-width: 900px; font-size: 13px; }
.prose .table--tests th { white-space: normal; vertical-align: bottom; min-width: 64px; }
.prose .table--tests td:first-child { min-width: 250px; white-space: normal; }
.prose .table--tests td:last-child { min-width: 0; }
.prose .ok { color: #6bd68f; font-weight: 500; }
.prose .bad { color: #ff857a; font-weight: 600; }
.prose ul.small { word-break: normal; color: var(--p-muted); }

/* support.html: the bug report and contact forms */
.support-form { display: grid; gap: 18px; margin: 8px 0 40px; padding: 24px; border: 1px solid #222d40; border-radius: 10px; background: #111827; }
.support-form label { display: grid; gap: 6px; font-size: 15px; font-weight: 500; color: var(--p-ink); }
.support-form .req { font-size: 12px; font-weight: 400; color: var(--p-muted); margin-inline-start: 6px; }
.support-form .hint { font-size: 13px; font-weight: 400; color: var(--p-muted); }
.support-form input, .support-form textarea, .support-form select {
  font: inherit; font-weight: 400; font-size: 15px; color: var(--p-ink); background: var(--p-bg); border: 1px solid #2a3750;
  border-radius: 6px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.support-form textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.support-form .mono { font-family: "DM Mono", ui-monospace, monospace; font-size: 13px; }
.support-form input:focus, .support-form textarea:focus, .support-form select:focus { outline: 2px solid var(--p-accent); outline-offset: 1px; border-color: var(--p-accent); }
.support-form .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.support-form button { justify-self: start; }
.support-form button[disabled] { opacity: .6; cursor: progress; }
.support-form .form-status { margin: 0; min-height: 1.5em; color: var(--p-muted); }
.support-form .form-status.ok { color: #5fd38d; }
.support-form .form-status.bad { color: #ff8a7a; }
.support-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 720px) { .support-form { padding: 16px; } .support-form .row { grid-template-columns: 1fr; } }

/* release notes: a version's changelog, then its commits folded */
.prose .changelog h4 { margin: 18px 0 6px; font-size: 15px; color: var(--p-muted); text-transform: none; }
.prose details { margin: 8px 0 32px; }
.prose details > summary { cursor: pointer; color: var(--p-muted); font-size: 14px; }
.prose details > summary:hover { color: var(--p-ink); }

/* languages: the switcher in the bar, the note on a page not yet translated, right-to-left, fonts that cover the script */
.lang-menu { position: relative; font-size: 14px; margin-inline-end: 12px; }
.lang-menu summary { list-style: none; cursor: pointer; padding: 7px 12px; border: 1px solid #2b3a52; border-radius: 8px; color: var(--p-ink); white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: " \25BE"; color: var(--p-muted); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); display: flex; flex-direction: column; min-width: 150px; padding: 6px; background: #121c2e; border: 1px solid #2b3a52; border-radius: 10px; z-index: 200; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.lang-list a { color: #c7d3e6; text-decoration: none; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }
.lang-list a:hover, .lang-list a[aria-current] { background: #1a2332; color: #fff; }
.i18n-note { margin: 0 0 24px; padding: 10px 14px; border: 1px solid #2b3a52; border-inline-start: 3px solid var(--p-accent); border-radius: 8px; color: var(--p-muted); font-size: 14px; }
html[lang="ar"] { --font-display: "Noto Sans Arabic", system-ui, "Segoe UI", sans-serif; --font-text: "Noto Sans Arabic", system-ui, "Segoe UI", sans-serif; }
html[lang="zh"] { --font-display: "Noto Sans SC", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; --font-text: "Noto Sans SC", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
html[lang="ar"] .prose { line-height: 1.9; }
[dir="rtl"] .prose pre, [dir="rtl"] .prose code, [dir="rtl"] .prose table.code { direction: ltr; text-align: left; unicode-bidi: plaintext; }
[dir="rtl"] .prose pre { unicode-bidi: normal; }

/* a picture of the editor under a tutorial step */
.tshot { margin: 1rem 0 1.4rem; }
.tshot img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid rgba(128, 128, 128, .28); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); background: #14161a; }

/* the language menu on a phone and a tablet: the bar keeps it beside the menu button (the other actions go into the sheet); in the
   open sheet it sits at the foot and its list opens upward, so it is not cut off by the screen's edge */
@media (max-width: 1023px) {
  .nav:not(.is-open) .nav__actions { display: flex !important; margin-left: auto; }
  .nav:not(.is-open) .nav__actions > :not(.lang-menu) { display: none !important; }
  .nav:not(.is-open) .nav__actions > .lang-menu { display: block !important; margin-inline-end: 0; }
  .nav:not(.is-open) .nav__actions + .nav__toggle { margin-left: 0; }
  .nav.is-open .nav__actions > .lang-menu { display: block; margin: 0; }
  .nav.is-open .lang-menu summary { text-align: center; padding: 12px; font-size: 16px; }
  .nav.is-open .lang-list { top: auto; bottom: calc(100% + 6px); inset-inline: 0; min-width: 0; }
  .nav.is-open .lang-list a { padding: 12px 14px; font-size: 16px; }
}
@media (max-width: 639px) { .lang-menu summary { padding: 9px 10px; min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; } }
