/* ═══════════════════════════════════════════════════════════════════════════
   cli.css — terminal frames for site/cli/, built by tools/build-cli-page.py

   THE COLOURS INSIDE A FRAME ARE NOT THIS FILE'S. Every span in a transcript
   carries an inline rgb() that the `prism` binary itself emitted, captured in
   truecolour on both grounds at build time. Nothing here restyles them, and
   nothing here may: the point of the page is that you are looking at the
   program's output, and a stylesheet that "improved" the palette would make it
   a picture of the program instead.

   So this file styles only the FRAME — the chrome around the transcript — and
   chooses which of the two captures to show.
   ═══════════════════════════════════════════════════════════════════════════ */

.term {
  margin: 22px 0 30px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--draft-2);
}

/* ── the title bar ───────────────────────────────────────────────────────── */
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--draft-3);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.term-dots {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.term-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule-2);
  display: block;
}

.term-cmd {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--ink-2);
  /* The command is the one line a reader copies. It scrolls in its own box
     rather than wrapping mid-flag or widening the frame. */
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 auto;
}
.term-cmd::-webkit-scrollbar { display: none; }

/* The exit status, stated rather than implied. A page that shows a failing
   command without showing that it failed is showing half of it. */
.term-exit {
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--seal);
  background: var(--seal-soft);
  border: 1px solid color-mix(in srgb, var(--seal) 22%, transparent);
}
.term-exit.bad {
  color: var(--oxide);
  background: var(--oxide-soft);
  border-color: color-mix(in srgb, var(--oxide) 22%, transparent);
}

/* ── the transcript ──────────────────────────────────────────────────────── */
.term-body {
  margin: 0;
  padding: 16px 16px 18px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  /* Wide output scrolls in its own box. The page body must never scroll
     sideways because a table of endpoint ids was long. */
  overflow-x: auto;
  tab-size: 2;
}
.term-body code { font: inherit; color: inherit; background: none; }

/* The two grounds. Each is the binary's own palette for that ground — the CLI
   reads COLORFGBG and picks — so this is a choice between two real captures,
   not a recolouring of one. Both ship; exactly one shows.

   Structured for the viewer's three states: an explicit choice stamps
   data-theme, and the default "system" setting stamps nothing, so bare :root
   must carry a complete answer on its own. */
.term-body.dark { display: none; }
.term-body.light { display: block; background: #FBFCF9; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .term-body.light { display: none; }
  :root:not([data-theme="light"]) .term-body.dark { display: block; background: #0D1214; }
}
:root[data-theme="dark"] .term-body.light { display: none; }
:root[data-theme="dark"] .term-body.dark { display: block; background: #0D1214; }
:root[data-theme="light"] .term-body.dark { display: none; }
:root[data-theme="light"] .term-body.light { display: block; background: #FBFCF9; }

/* ── the caption ─────────────────────────────────────────────────────────── */
.term figcaption {
  padding: 11px 16px 13px;
  border-top: 1px solid var(--rule);
  background: var(--draft-3);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.55;
}

/* ── the honesty note ────────────────────────────────────────────────────── */
p.note {
  border-inline-start: 3px solid var(--brass);
  background: var(--brass-soft);
  padding: 11px 15px;
  border-radius: 0 7px 7px 0;
  color: var(--ink-2);
}

/* Phone: the frame loses its side padding before the transcript loses its
   legibility, and the title bar stacks rather than squeezing the command
   into nothing. */
@media (max-width: 560px) {
  .term-body { padding: 13px 12px 15px; font-size: 11.5px; }
  .term-bar { flex-wrap: wrap; gap: 8px 10px; }
  .term-cmd { order: 3; flex-basis: 100%; }
}

/* Installation belongs beside the real transcript, in the same page palette. */
.cli-install { padding: 0 0 30px; margin-bottom: 34px; border-bottom: 1px solid var(--rule); }
.cli-install-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; }
.cli-install-tabs button { font: inherit; font-size: 13px; padding: 9px 14px; color: var(--ink-2); background: var(--draft-2); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.cli-install-tabs button[aria-selected="true"] { color: var(--seal); border-color: var(--seal); background: var(--seal-soft); }
.cli-install-tabs button:disabled, .cli-install-actions button:disabled { cursor: default; opacity: .65; }
.cli-install-panel { margin-top: 12px; padding: 18px 20px 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--draft-2); min-width: 0; }
.cli-install-hint { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.cli-install-command { display: block; max-width: 100%; margin: 0; padding: 14px 0 16px; overflow: auto; white-space: pre; text-align: left; direction: ltr; font: 12px/1.65 "IBM Plex Mono", ui-monospace, monospace; background: transparent; border: 0; color: var(--ink); }
.cli-install-command code { font: inherit; color: inherit; background: transparent; padding: 0; border: 0; }
.cli-install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 4px; font-size: 12px; }
.cli-install-status { min-height: 1.6em; margin: 10px 0 12px; color: var(--seal); font-size: 12px; }
.cli-install-next { margin: 20px 0 8px; }
.cli-install-updates { margin: 0; color: var(--ink-3); font-size: 13px; }
.cli-install-trust { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; }
@media (max-width: 560px) { .cli-install-panel { padding: 14px 14px 0; } .cli-install-tabs button { padding: 8px 11px; } }

.cli-install-next code, .cli-install-updates code { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

/* Keep anchored headings below the 60px sticky navigation. */
html[data-page="cli"] main section[id] {
  scroll-margin-top: 80px;
}
