/* The user guide. Every page of the guide links this file. The cell and
 * the control plane both serve it, so the text uses system fonts. The
 * header has the font of the landing page, from /guide/brand/. Both
 * themes follow the system setting:
 * the page has no script, so it has no theme toggle. Every text colour
 * passes 4.5:1 on its background in both themes. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #e9f6ff;
  --fg: #1f2328;
  --fg-muted: #57606a;
  --line: #d0d7de;
  --link: #0a5bb5;
  --focus: #0a5bb5;
  --code-bg: #eff1f3;
  --code-fg: #1f2328;
  --note-bg: #eef5ff;
  --note-line: #3d7ad6;
  --warn-bg: #fff6e5;
  --warn-line: #b36b00;
  --accent: #0a5bb5;
  --mark: #c2255c;
  --head-bg: #081c2e;
  --head-blue: #359cf3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-soft: #161a20;
    --fg: #e6e8eb;
    --fg-muted: #a3aab4;
    --line: #2d333b;
    --link: #6cb6ff;
    --focus: #6cb6ff;
    /* Lighter than the page, so a word of code stands out from the text. */
    --code-bg: #2b313b;
    --code-fg: #f0f3f6;
    --note-bg: #13233a;
    --note-line: #4d8fe0;
    --warn-bg: #2b2111;
    --warn-line: #d29922;
    --accent: #6cb6ff;
  }
}

@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 300 800;
  /* Keep the first layout when a slow font misses the initial paint. */
  font-display: optional;
  src: url(/guide/brand/league-spartan.woff2) format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }

/* A section that a link opens starts a little below the top of the window. */
html { scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* The header is the header of the landing page (internal/controlplane/
 * assets/site.css): the logo, the product name, and the navy bar. It has
 * the same colours in both themes, as the landing page has one theme.
 * White on --head-bg is 17:1, and --head-blue on it is 5.9:1. */
.topbar { background: var(--head-bg); color: #fff; font-family: "League Spartan", system-ui, -apple-system, "Segoe UI", sans-serif; }
.topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 4.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.1rem;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand-logo { height: 34px; width: auto; }
.brand-divider { width: 1px; height: 26px; background: rgba(255, 255, 255, 0.25); }
.brand-product { font-size: 21px; font-weight: 600; letter-spacing: 0.01em; padding-top: 4px; }
/* The beta mark beside the product name: white on the navy bar. */
.beta {
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px;
  padding: 4px 10px 1px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.brand-doc {
  margin: 0;
  padding: 4px 0 0 1.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--head-blue);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 26px;
}

.topbar :focus-visible { outline-color: #fff; }

@media (max-width: 30rem) {
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }
  .brand-divider { height: 20px; }
  .brand-product, .brand-doc { font-size: 17px; }
  .brand-doc { padding-left: 0.75rem; line-height: 20px; }
  .topbar-inner { min-height: 3.75rem; gap: 0.25rem 0.75rem; padding: 0.4rem 1rem; }
}

/* The narrowest windows: "User guide" goes under the logo, with no line
 * at its left. */
@media (max-width: 24rem) {
  .brand-doc { flex-basis: 100%; border-left: 0; padding-left: 0; }
}

.layout {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "sidebar" "toc" "main";
  gap: 1.5rem 2rem;
}
.sidebar { grid-area: sidebar; }
.toc { grid-area: toc; }
main { grid-area: main; }

/* A wide window: the groups at the left, the list "On this page" above
 * the text. A very wide one: the list at the right of the text. Each
 * list stays in view while the page scrolls. */
@media (min-width: 64rem) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-areas: "sidebar toc" "sidebar main";
    grid-template-rows: auto 1fr;
  }
  .sidebar { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
@media (min-width: 88rem) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr) 14rem;
    grid-template-areas: "sidebar main toc";
    grid-template-rows: auto;
  }
  .toc { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
}

/* The sidebar: the overview, then the groups. The current page is bold,
 * with a bar at its left: the colour is not the only cue. On a narrow
 * window only the group of the current page lists its pages; each other
 * group is one link to its first page. */
.sidebar { font-size: 0.95rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 0.3rem 0.6rem;
  color: var(--fg);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar a:hover { text-decoration: underline; }
.sidebar a[aria-current="page"] { font-weight: 700; color: var(--link); border-left-color: var(--accent); background: var(--bg-soft); }
.sidebar .group { margin-top: 0.75rem; }
.sidebar .group-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.sidebar .group ul a { padding-left: 1rem; }
/* The button that opens the list of the pages on a narrow window. It
 * shows only with guide.js (the sidebar then has the class collapsible);
 * without the script the list stays open. */
.nav-toggle {
  display: none;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--fg-muted);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.nav-toggle::after { content: " ▾"; }
.nav-toggle[aria-expanded="true"]::after { content: " ▴"; }
@media (max-width: 63.99rem) {
  .sidebar.collapsible .nav-toggle { display: block; }
  .sidebar.collapsible:not(.open) .groups { display: none; }
  .sidebar.collapsible.open .groups { margin-top: 0.5rem; }
  .sidebar { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
  .sidebar .group { margin-top: 0.25rem; }
  /* With no script, the list stays open: each other group is one link.
   * With the script, the open list shows each page (two clicks to any page). */
  .sidebar:not(.collapsible) .group:not(.current) ul { display: none; }
  .sidebar .group-name { color: var(--link); text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
}

/* The search box at the top of the sidebar (SC-3892; guide.js). It shows
 * only with the script. A result is a link to its section, with the
 * page, the section, and a part of its text, where a <mark> holds each
 * matched word. The mark keeps dark text on a light fill in both themes
 * (#1f2328 on #ffe58f is 13:1), and the weight is a second cue. */
.search { margin: 0 0 1rem; }
.search label { display: block; margin: 0 0 0.25rem; font-size: 0.9rem; font-weight: 600; }
.search input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--fg-muted);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.search-hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--fg-muted); }
.search-shortcut {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
/* The alert region stays in the page with no text, so a screen reader
 * reads the error when the text comes; it gets its box only then. */
.search-error { margin: 0; color: var(--fg); font-size: 0.85rem; }
.search-error:not(:empty) { margin-top: 0.5rem; padding: 0.4rem 0.6rem; border-left: 3px solid var(--warn-line); background: var(--warn-bg); }
.search-results { list-style: none; margin: 0.5rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 60vh; overflow-y: auto; }
.sidebar .search-results li + li { border-top: 1px solid var(--line); }
.sidebar .search-results a { padding: 0.4rem 0.6rem 0.15rem; }
.result-page { font-weight: 700; }
.result-section { display: block; }
.result-snippet { margin: 0; padding: 0 0.6rem 0.45rem; font-size: 0.8rem; color: var(--fg-muted); overflow-wrap: anywhere; }
.result-snippet mark { background: #ffe58f; color: #1f2328; font-weight: 600; border-radius: 2px; }

/* The type of the page (tutorial, how-to guide, reference, concept),
 * above its title. */
.kind { margin: 0 0 0.25rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); }

.toc { font-size: 0.9rem; }
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin: 0 0 0.5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.2rem 0; }
.toc a { display: inline-block; padding: 0.15rem 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* The text keeps a line of 48rem. A picture can be wider: it shows a
 * page of the portal, and its text must stay readable. */
main { min-width: 0; max-width: 56rem; }
main > * { max-width: 48rem; }
main > .shot { max-width: none; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 2.75rem 0 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
h2, h3 { position: relative; }

/* The "#" link of a heading: the link of the section, which guide.js
 * copies on a click. After the text on a narrow window; left of the
 * heading, in the gap before the text, on a wide one. */
.anchor { margin-left: 0.4rem; color: var(--fg-muted); font-weight: 400; text-decoration: none; }
.anchor:hover, .anchor:focus-visible { color: var(--link); }
.anchor.copied { position: relative; }
.anchor.copied::after {
  content: "Link copied";
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}
@media (min-width: 64rem) {
  .anchor { position: absolute; left: -1.5rem; margin: 0; }
  h2 .anchor { top: 0.5rem; }
  h3 .anchor { top: 0; }
  .anchor.copied { position: absolute; }
}

/* Text for a screen reader only. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lead { font-size: 1.1rem; color: var(--fg-muted); margin-top: 0; }

p, ul, ol, dl, table, pre { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li { margin: 0.25rem 0; }
dt { font-weight: 600; margin-top: 0.75rem; }
dd { margin: 0.1rem 0 0 1.25rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--code-fg);
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  /* Wrap long lines: a code block never makes the page scroll sideways. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre code { background: none; padding: 0; font-size: 0.85rem; }
/* The Copy button of a code block (guide.js). The block keeps room at
   its right for the button, so the button never covers the code. */
.code-block { position: relative; }
.code-block pre { padding-right: 4.75rem; }
.copy-code {
  position: absolute; top: 0.4rem; right: 0.4rem;
  font: inherit; font-size: 0.8rem; line-height: 1.2;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--fg-muted); border-radius: 4px;
  padding: 0.2rem 0.55rem; cursor: pointer;
}
.copy-code:hover { color: var(--link); border-color: var(--link); }

kbd, .ui {
  font-weight: 600;
}

.note, .warn {
  border-left: 4px solid var(--note-line);
  background: var(--note-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0 0 1rem;
}
.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.note strong:first-child, .warn strong:first-child { display: block; }

.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; margin: 0; }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.25rem; margin: 0.6rem 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--fg);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.3rem;
}

/* The diagram of the overview. Its colours are the tokens above, so it
 * follows the theme. On a narrow screen it keeps a width at which its
 * text is readable, and scrolls inside its frame. */
.diagram {
  overflow-x: auto;
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
}
.diagram svg { display: block; width: 100%; min-width: 36rem; height: auto; }
.diagram text { fill: var(--fg); font-size: 14px; }
.diagram .name { font-size: 15px; font-weight: 700; }
.diagram .sub { fill: var(--fg-muted); font-size: 13px; }
.diagram .box { fill: var(--bg); stroke: var(--fg-muted); stroke-width: 1.5; }
.diagram .life { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 4 5; }
.diagram .arrow { stroke: var(--accent); stroke-width: 2; }
.diagram .head { fill: var(--accent); }

/* A picture of the portal (tools/guide-shots). The numbers of the
 * caption are the numbers that the picture has, in the same colour:
 * white on --mark is 5.6:1. */
.shot { margin: 1.25rem 0 1.5rem; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.shot figcaption { margin-top: 0.5rem; font-size: 0.93rem; color: var(--fg-muted); }
.badge-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.marks { list-style: none; counter-reset: mark; margin: 0.4rem 0 0; padding: 0; color: var(--fg); }
.marks li { counter-increment: mark; position: relative; padding-left: 2rem; margin: 0.35rem 0; }
.marks li::before {
  content: counter(mark);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--mark);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4rem;
}

/* A choice of one panel among several, for example the ways to install
 * the CLI. The buttons are radio buttons that look like tabs, so the
 * keyboard works as for any radio group. No script: :has() shows the
 * panel of the checked button. A browser without :has() shows every
 * panel, one under the other. */
.choice { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 6px; }
.choice-tabs {
  /* A fieldset is at least as wide as its content: with that, the row
   * would widen the page in place of scrolling. */
  min-inline-size: 0;
  margin: 0;
  padding: 0.6rem 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: var(--bg-soft);
}
.choice-tabs legend { padding: 0 0 0.4rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); }
/* The buttons stay on one line. When the line is wider than the page,
 * it scrolls sideways; the focused button scrolls into view. */
.choice-row { display: flex; flex-wrap: nowrap; gap: 0.3rem; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 0.4rem; }
.choice-tabs input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.choice-tabs label {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 0.93rem;
  white-space: nowrap;
  cursor: pointer;
}
.choice-tabs label:hover { color: var(--fg); }
/* A row of long labels (the systems of the Radar install) wraps: each
 * button takes a line of its own when it does not fit, and its text wraps. */
.choice-row.wrap { flex-wrap: wrap; overflow-x: visible; }
.choice-row.wrap label { flex: 0 1 auto; white-space: normal; }
.choice-tabs input:checked + label { color: var(--fg); font-weight: 600; background: var(--bg); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.choice-tabs input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-panel { padding: 0.9rem 1rem 0; }
.choice-panel > :last-child { margin-bottom: 1rem; }
@supports selector(:has(*)) {
  .choice-panel { display: none; }
  .choice:has(#im-script:checked) #panel-im-script,
  .choice:has(#im-brew:checked) #panel-im-brew,
  .choice:has(#im-npm:checked) #panel-im-npm,
  .choice:has(#im-python:checked) #panel-im-python,
  .choice:has(#im-docker:checked) #panel-im-docker,
  .choice:has(#im-apt:checked) #panel-im-apt,
  .choice:has(#im-dnf:checked) #panel-im-dnf,
  .choice:has(#im-maven:checked) #panel-im-maven,
  .choice:has(#im-gradle:checked) #panel-im-gradle,
  .choice:has(#im-manual:checked) #panel-im-manual,
  .choice:has(#os-script:checked) #panel-os-script,
  .choice:has(#os-brew:checked) #panel-os-brew,
  .choice:has(#os-npm:checked) #panel-os-npm,
  .choice:has(#os-pipx:checked) #panel-os-pipx,
  .choice:has(#pkg-rpm:checked) #panel-pkg-rpm,
  .choice:has(#pkg-deb:checked) #panel-pkg-deb { display: block; }
}

.topics > li { margin: 0.6rem 0; }
.topics > li > a { font-weight: 600; }

.next { margin: 3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 600; }

/* "Was this page helpful?" and "Report a docs problem" at the end of each
 * page (SC-3909; guide.js). The section shows only with the script. A
 * pressed vote has a fill and a check mark: the colour is not the only
 * cue. The alert region gets its box only with a text, as the error of
 * the search does. */
.feedback { margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.feedback h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.feedback-vote { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.feedback button {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--fg-muted);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.feedback button:hover { border-color: var(--link); color: var(--link); }
.feedback button[aria-pressed="true"] { background: var(--bg-soft); border-color: var(--link); font-weight: 600; }
.feedback button[aria-pressed="true"]::before { content: "✓ "; }
.feedback-status { margin: 0.5rem 0 0; font-size: 0.9rem; }
.feedback-status:empty { margin: 0; }
.feedback-report { margin-top: 0.75rem; }
.feedback-report summary { color: var(--link); cursor: pointer; text-decoration: underline; width: fit-content; }
.feedback-form { margin-top: 0.75rem; }
.feedback-form label { display: block; font-weight: 600; }
.feedback-hint { margin: 0.25rem 0 0.5rem; font-size: 0.85rem; color: var(--fg-muted); }
.feedback-form textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 40rem;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--fg-muted);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.feedback-error { margin: 0; color: var(--fg); font-size: 0.85rem; }
.feedback-error:not(:empty) { margin-bottom: 0.5rem; padding: 0.4rem 0.6rem; border-left: 3px solid var(--warn-line); background: var(--warn-bg); }

.footer { border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 0.9rem; }
.footer p { max-width: 80rem; margin: 0 auto; padding: 1rem; }
