/* tqdm Labs, the one brand source (feature 038). Every surface on both origins
   links this file before its own stylesheet and takes its colours, faces, the
   mark and the focus ring from here; a surface stylesheet aliases its own
   names to these and writes no colour of its own (internal/brand/guard_test.go).
   Values: tmp/brand/tokens.md, approved 2026-10-04. Two materials: console
   (chrome, terminals, heroes) and paper (anything read or filled in). */

/* Geist and Geist Mono (vercel/geist-font v1.8.1, OFL), the weights the
   platform draws in (feature 055); JetBrains Mono is the mark's alone */
@font-face { font-family: Geist; font-style: normal; font-weight: 400; font-display: swap; src: url(/brand/fonts/Geist-Regular.woff2) format("woff2"); }
@font-face { font-family: Geist; font-style: normal; font-weight: 500; font-display: swap; src: url(/brand/fonts/Geist-Medium.woff2) format("woff2"); }
@font-face { font-family: Geist; font-style: normal; font-weight: 600; font-display: swap; src: url(/brand/fonts/Geist-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/brand/fonts/GeistMono-Regular.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/brand/fonts/GeistMono-Medium.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/brand/fonts/GeistMono-Bold.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/brand/fonts/JetBrainsMono-Bold.woff2) format("woff2"); }

:root {
  /* console */
  --tq-console: #1f2226;             /* terminal, stage, hero ground */
  --tq-console-raised: #2e3136;      /* bars, tab strip */
  --tq-console-surface: #272a2f;     /* header and gutters around panes */
  --tq-console-card: #373a3f;        /* pills, menus, dialogs, toasts */
  --tq-console-chip: #23262b;        /* address and code chips */
  --tq-console-hover: #42454a;       /* hover fill */
  --tq-console-line: #414449;        /* hairline */
  --tq-console-line-mid: #52555a;    /* terminal frame, button outline */
  --tq-console-line-strong: #6d7075; /* strong outline, idle dot */
  --tq-console-text: #eff1f5;
  --tq-console-text-dim: #c2c4c8;
  --tq-console-text-mute: #a1a3a7;   /* 4.52:1 on console-card */
  --tq-white: #ffffff;               /* text on ink, the console primary's hover */

  /* signal: states only, never a button */
  --tq-signal: #82e778;              /* ready, running, passed, connected; the mark's chevron on console */
  --tq-signal-deep: #64bd5b;         /* the focus ring on console */
  --tq-info: #7b9dc9;                /* the prompt's directory, links on console, a Preview tab's globe */
  --tq-warn: #e8c56a;                /* under five minutes, warnings on console */
  --tq-fault: #ff6b6b;               /* disconnected, failed, on console */
  --tq-danger-text: #ffb4ab;         /* a destructive control's hover on console */
  --tq-danger-field: #3a2626;
  --tq-danger-line: #6a3a3a;

  /* paper */
  --tq-paper: #f6f8fc;               /* sheet ground */
  --tq-paper-foot: #eef2f9;          /* sheet head, bands, fold summaries */
  --tq-paper-card: #ffffff;          /* cards on paper */
  --tq-ink: #1b2233;                 /* headings, primary text, the paper's action fill, links */
  --tq-ink-hover: #2a3550;           /* the paper primary's hover */
  --tq-ink-text: #2b3748;            /* body text */
  --tq-ink-mute: #5b6780;            /* secondary text */
  --tq-ink-dash: #c2ccdd;            /* a live card's ring, paper selection */
  --tq-rule: #d9e0ec;                /* hairline */
  --tq-ring: #7f8ba3;                /* outline buttons, the state node's ring */
  --tq-slab: #e7ecf5;                /* code block on paper */
  --tq-slab-rule: #dae1ee;
  --tq-field: #f3f7fd;               /* an editable field's fill on paper (Studio); ink 14.76:1, mute 5.28:1 on it */
  --tq-field-rule: #7996c3;          /* that field's ring, 3.02:1 on the card */

  /* code on paper, "Worksheet": the terminal's hues pulled down to paper
     contrast, each 5.5:1 or more on --tq-paper; green stays out of code,
     since on this platform it means passed */
  --tq-code-key: #2f5a94;            /* a key, an attribute, a tag */
  --tq-code-string: #1b6a6a;         /* a string */
  --tq-code-number: #94550f;         /* a number, true, null */
  --tq-code-flag: #7c3a8e;           /* a variable, a flag */
  --tq-code-mark: #e3ebf7;           /* a marked line's band */

  /* the paper's action and the command block: a pale worksheet blue, a step from the paper, never a jump */
  --tq-action: #e3ebf7;              /* the paper's primary action fill; action text 8.43:1 on it */
  --tq-action-text: #23426e;
  --tq-action-rule: #b9cbe6;
  --tq-action-hover: #d6e2f3;        /* action text 7.72:1 on it */
  --tq-action-hover-rule: #7996c3;
  --tq-cmd: #eef3fb;                 /* a command block's ground; ink mute 5.1:1, every code colour 5.6:1 or more */
  --tq-cmd-head: var(--tq-action);
  --tq-cmd-rule: #c9d6ea;

  /* states on paper */
  --tq-pass: #1f7a4c; --tq-pass-field: #e8f5ee; --tq-pass-rule: #bcd9c8;   /* also the mark's chevron on paper */
  --tq-fail: #b3261e; --tq-fail-field: #fdecea; --tq-fail-rule: #f0c4bf;
  --tq-hint: #8a6d00; --tq-hint-field: #fdf8ec; --tq-hint-dash: #c9b37a; --tq-hint-rule: #b8860b;

  /* the one red: confirming End session, Submit exam */
  --tq-danger: #c0392b;
  --tq-danger-hover: #a83326;

  /* the terminal (xterm.js reads these by name in cockpit.js, so plain hex
     only: a var() or color-mix() here reaches xterm.js as unparsed text).
     Green and the greys follow the shift; the other colours are the
     cockpit's own since feature 022. */
  --tq-term-bg: #1f2226;
  --tq-term-fg: #eff1f5;
  --tq-term-cursor: #eff1f5;
  --tq-term-selection: #354d38;
  --tq-term-black: #373a3f;
  --tq-term-red: #ff6b6b;
  --tq-term-green: #82e778;
  --tq-term-yellow: #e8c56a;
  --tq-term-blue: #7b9dc9;
  --tq-term-magenta: #c79bdc;
  --tq-term-cyan: #6dd3d3;
  --tq-term-white: #c7c9cd;
  --tq-term-bright-black: #6b6e73;
  --tq-term-bright-red: #ff8585;
  --tq-term-bright-green: #82e778;
  --tq-term-bright-yellow: #f0d382;
  --tq-term-bright-blue: #7b9dc9;
  --tq-term-bright-magenta: #d6afe8;
  --tq-term-bright-cyan: #86e0e0;
  --tq-term-bright-white: #eff1f5;

  /* type */
  --tq-font-ui: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tq-font-mark: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --tq-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* the scrims behind a modal and the shadows of what floats over a page:
     black overlays, the one colour a surface may write, named once here so
     every surface floats alike (DESIGN.md, Elevation & Depth) */
  --tq-scrim: rgba(0, 0, 0, .6);              /* behind a dialog on console */
  --tq-scrim-light: rgba(0, 0, 0, .45);       /* behind the builder's paper dialog */
  --tq-shadow-modal: 0 18px 50px rgba(0, 0, 0, .55);
  --tq-shadow-modal-light: 0 18px 50px rgba(0, 0, 0, .28); /* a paper dialog */
  --tq-shadow-menu: 0 14px 40px rgba(0, 0, 0, .5);
  --tq-shadow-menu-light: 0 12px 32px rgba(0, 0, 0, .35);  /* the builder's overflow menu */
  --tq-shadow-toast: 0 10px 30px rgba(0, 0, 0, .45);

  /* the focus ring: ink on paper by default; a console region restates
     --tq-focus as --tq-signal-deep, since ink on console reads as no ring */
  --tq-focus: var(--tq-ink);

  /* a select's chevron: Lucide's chevron-down (ISC, lucide.dev), unaltered,
     drawn as a mask so the surface picks its colour (Studio, the signed-in app) */
  --tq-chevron-down: url("/brand/icons/chevron-down.svg");
}

:focus-visible { outline: 2px solid var(--tq-focus); outline-offset: 2px; }

/* hidden means hidden, whatever display a page's own rule gives the element */
[hidden] { display: none !important; }

/* The browser's own surfaces, themed once: selection and caret follow
   --tq-focus, the material switch every surface flips (ink on paper,
   signal-deep on console); one scrollbar thumb, the ring, reads on both. */
:root { scrollbar-color: var(--tq-ring) transparent; }
::selection { background: color-mix(in srgb, var(--tq-focus) 24%, transparent); }
:where(input, textarea, [contenteditable]) { caret-color: var(--tq-focus); }

/* ---- the mark: ❯ tqdm labs, always a link home ----------------------------- */

.tq-mark {
  display: inline-flex; align-items: center; gap: .45em; flex: none;
  font: 700 18px/1 var(--tq-font-mark); letter-spacing: -0.02em; white-space: nowrap;
  color: var(--tq-console-text); text-decoration: none; border-radius: 4px;
  --tq-focus: var(--tq-signal-deep);
}
.tq-mark svg {
  flex: none; display: block; width: .55em; height: .88em;
  fill: none; stroke: var(--tq-signal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}
.tq-mark .tq-mark-labs { margin-left: .15em; color: var(--tq-console-text-mute); }
.tq-mark--paper { color: var(--tq-ink); --tq-focus: var(--tq-ink); }
.tq-mark--paper svg { stroke: var(--tq-pass); }
.tq-mark--paper .tq-mark-labs { color: var(--tq-ink-mute); }

/* ---- popups: beside what asked (feature 049) ------------------------------- */

/* /brand/anchor.js gives a popup .tq-pop, places it beside the control that
   opened it and sets data-side and --pointer-x; the pointer is drawn in the
   popup's own surface, which each page names in --tq-pop-bg and --tq-pop-line.
   A question with nothing to point at is centred; on a phone every question
   is a sheet along the bottom, and anchor.js sets no side, so no pointer. */
dialog.tq-pop[data-anchored] { position: fixed; inset: auto; margin: 0; }
.tq-pop[data-side]::before {
  content: ""; position: absolute; left: calc(var(--pointer-x, 50%) - 6px); width: 11px; height: 11px;
  transform: rotate(45deg); background: var(--tq-pop-bg); border: 1px solid var(--tq-pop-line);
}
.tq-pop[data-side="below"]::before { top: -7px; border-right: 0; border-bottom: 0; }
.tq-pop[data-side="above"]::before { bottom: -7px; border-left: 0; border-top: 0; }
/* a sheet is a sheet, whatever size or place a page's own rule gives its dialog */
@media (max-width: 640px) {
  dialog.tq-pop {
    position: fixed !important; inset: auto 0 0 0 !important; margin: 0 !important;
    width: 100% !important; max-width: none !important; border-radius: 14px 14px 0 0 !important;
  }
}
/* the second question's consequence, on paper */
.tq-again { padding: 9px 11px; border-radius: 7px; background: var(--tq-fail-field); border: 1px solid var(--tq-fail-rule); color: var(--tq-fail); }

/* Studio's approved graphite paper material, opt-in so other pages keep their palette. */
:root {
  --tq-studio-paper: #e9eaeb;
  --tq-studio-foot: #eff0f1;
  --tq-studio-ink: #24272b;
  --tq-studio-hover: #383d43;
  --tq-studio-text: #484e55;
  --tq-studio-mute: #626970;
  --tq-studio-dash: #c3c7cb;
  --tq-studio-rule: #d4d7da;
  --tq-studio-ring: #858c94;
  --tq-studio-slab: #e9ebed;
  --tq-studio-slab-rule: #d1d5d9;
  --tq-studio-field: #f7f8f8;
  --tq-studio-field-rule: #858c94;
}

/* ---- code blocks: the cockpit's and Studio's preview's (codeblock.ts) ------ */

/* Two kinds of block: a command, which the student runs, on the pale
   worksheet blue with a prompt and the machine's name; a file, which the student reads, on paper with its
   name, its line numbers and the Worksheet colours. A one-line command has
   no head, its copy button beside it. */
.tq-code { margin: 12px 0; border-radius: 8px; overflow: hidden; font: 13px/1.7 var(--tq-font-mono); }
.tq-code pre { margin: 0; padding: 12px 16px 14px; min-width: 0; overflow-x: auto; scrollbar-width: thin; background: none; border: 0; border-radius: 0; }
.tq-code pre code {
  display: block; padding: 0; border: 0; border-radius: 0; background: none;
  font: inherit; color: inherit; white-space: pre; overflow-wrap: normal;
}
.tq-code-head { display: flex; align-items: center; gap: 8px; height: 36px; padding-left: 14px; font: 500 12px/1 var(--tq-font-mono); }
.tq-code-head svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tq-code-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-code-actions { display: flex; align-self: stretch; }
.tq-code .copy {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; margin: 0; padding: 0;
  color: inherit; background: transparent; border: 0; border-radius: 0; cursor: pointer; transition: color .12s, background .12s;
}
.tq-code .copy svg { width: 16px; height: 16px; flex: none; }
.tq-code .copy:focus-visible { outline: 2px solid var(--tq-focus); outline-offset: -4px; }
.tq-code-one { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; }
.tq-code-one pre { padding: 11px 0 11px 16px; }
.tq-code-one .copy { width: 44px; height: 44px; }

.tq-code-cmd { background: var(--tq-cmd); border: 1px solid var(--tq-cmd-rule); color: var(--tq-ink); }
.tq-code-cmd .tq-code-head { background: var(--tq-cmd-head); border-bottom: 1px solid var(--tq-cmd-rule); color: var(--tq-ink-text); }
.tq-code-cmd .copy { color: var(--tq-ink-text); }
.tq-code-cmd .copy:hover { color: var(--tq-ink); background: var(--tq-action-hover); }
.tq-code-cmd .copy.did { color: var(--tq-pass); background: var(--tq-pass-field); }
.tq-code-cmd .tq-ln-cmd::before { content: "$ "; color: var(--tq-ink-mute); }
.tq-code-cmd .tq-ln-out { color: var(--tq-ink-text); }
.tq-code-cmd .syntax-command { color: var(--tq-ink); font-weight: 600; }
.tq-code-cmd .syntax-option { color: var(--tq-code-key); }
.tq-code-cmd .syntax-string { color: var(--tq-code-string); }
.tq-code-cmd .syntax-key { color: var(--tq-code-flag); }
.tq-code-cmd .syntax-comment { color: var(--tq-ink-mute); font-style: italic; }

.tq-code-file { background: var(--tq-paper); border: 1px solid var(--tq-ink-dash); color: var(--tq-ink); }
.tq-code-file .tq-code-head { background: var(--tq-paper-foot); border-bottom: 1px solid var(--tq-rule); color: var(--tq-ink); }
.tq-code-file .tq-code-head svg { color: var(--tq-ink-text); }
.tq-code-file .copy { color: var(--tq-ink-text); }
.tq-code-file .copy:hover { color: var(--tq-ink); background: var(--tq-rule); }
.tq-code-file .copy.did { color: var(--tq-pass); background: var(--tq-pass-field); }
/* the marks are drawn first, so the numbers and the code paint over them */
.tq-code-body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); }
.tq-code-body pre { position: relative; padding-left: 2px; }
.tq-code-gutter { position: relative; padding: 12px 12px 14px 14px; text-align: right; color: var(--tq-ink-mute); user-select: none; -webkit-user-select: none; }
.tq-code-gutter span { display: block; }
.tq-code-gutter .on { color: var(--tq-ink); font-weight: 600; }
.tq-code-mark { position: absolute; left: 0; right: 0; top: calc(12px + (var(--n) - 1) * 1.7em); height: 1.7em; background: var(--tq-code-mark); }
.tq-code-file .hljs :is(.hljs-comment, .hljs-quote, .hljs-meta) { color: var(--tq-ink-mute); font-style: italic; }
.tq-code-file .hljs :is(.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type, .hljs-title, .hljs-section) { color: var(--tq-ink); font-weight: 600; }
.tq-code-file .hljs :is(.hljs-string, .hljs-regexp, .hljs-char) { color: var(--tq-code-string); }
.tq-code-file .hljs :is(.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-tag, .hljs-selector-class, .hljs-selector-id, .hljs-link) { color: var(--tq-code-key); }
.tq-code-file .hljs :is(.hljs-number, .hljs-symbol, .hljs-literal) { color: var(--tq-code-number); }
.tq-code-file .hljs :is(.hljs-variable, .hljs-template-variable) { color: var(--tq-code-flag); }
.tq-code-file .hljs .hljs-bullet { color: var(--tq-ink-mute); }
.tq-code-file .hljs .hljs-addition { color: var(--tq-pass); background: var(--tq-pass-field); }
.tq-code-file .hljs .hljs-deletion { color: var(--tq-fail); background: var(--tq-fail-field); }
