/* deepseek-cli site
 *
 * Same design tokens as thevibeworks.github.io — black, mono, cyan and
 * pink — so this reads as family. Tuned for documentation rather than a
 * project index: the org page is a card wall, this is long-form text
 * with tables and terminal output, and those want different rhythm.
 *
 * No framework, no build step, no JS required to read anything.
 *
 * Two themes. The default follows the system; the toggle in the masthead
 * overrides it and persists. Every token is declared twice: the dark
 * value alone first, then the light-dark() pair. A browser without
 * light-dark() keeps the dark value and the site still works — the
 * declaration it cannot parse is the second one, and it drops it.
 *
 * light-dark() reads color-scheme, so forcing a theme is one property on
 * :root rather than a duplicate block per token. It also drags form
 * controls, scrollbars and caret colour along for free.
 */

:root {
    color-scheme: light dark;

    --bg: #000000;
    --bg: light-dark(#fbfaf7, #000000);
    --surface: #0d0d0d;
    --surface: light-dark(#f2f1ec, #0d0d0d);
    --surface-2: #141414;
    --surface-2: light-dark(#e8e7e0, #141414);
    --line: #262626;
    --line: light-dark(#d4d1c7, #262626);
    --text: #e8e8e8;
    --text: light-dark(#17171a, #e8e8e8);
    --muted: #9a9a9a;
    --muted: light-dark(#5a5a60, #9a9a9a);

    /* Accents are not shared between themes. The dark set is tuned for a
     * black backdrop and every one of them fails 4.5:1 on paper; these
     * are the darkened equivalents, all measured at 4.7:1 or better
     * against --bg, --surface and --surface-2. */
    --cyan: #00c2e9;
    --cyan: light-dark(#0a6e85, #00c2e9);
    --pink: #e41478;
    --pink: light-dark(#bd0e60, #e41478);
    --purple: #bf00ff;
    --purple: light-dark(#7a12b8, #bf00ff);
    --yellow: #ffd53d;
    --yellow: light-dark(#7a5200, #ffd53d);

    /* Strong text is brighter than body text on black and darker than it
     * on paper — "bolder" is a direction, not a colour. */
    --strong: #ffffff;
    --strong: light-dark(#000000, #ffffff);

    /* The masthead's translucent backdrop, per theme. */
    --masthead-bg: rgba(0, 0, 0, 0.9);
    --masthead-bg: light-dark(rgba(251, 250, 247, 0.9), rgba(0, 0, 0, 0.9));

    /* Scan lines are texture on black. On paper they are dirt, so the
     * light value is fully transparent rather than a fainter tint. */
    --scanline: rgba(0, 194, 233, 0.025);
    --scanline: light-dark(transparent, rgba(0, 194, 233, 0.025));

    --measure: 68ch;
    --gutter: 1.5rem;

    /* Motion. Two durations and one curve, used by every transition on
     * the site: fast for colour and border changes that answer the
     * pointer, slow for anything that moves or that follows the theme.
     * One vocabulary is what makes the interactions feel designed
     * rather than accumulated. */
    --dur-fast: 140ms;
    --dur-slow: 320ms;
    --ease: cubic-bezier(0.25, 0, 0.2, 1);

    /* The sea. waves.js reads every one of these off :root and paints
     * with them, so the two themes are settled here with the rest of the
     * palette rather than duplicated in JavaScript.
     *
     * --sea-0 is the farthest layer and --sea-3 the nearest; they run
     * from a pale horizon down to something close to the accent, which
     * is what gives the water depth. --sea-deep is the bottom of every
     * layer's gradient, so it is the colour of the floor.
     *
     * Dark: a lit sea at night, bright enough to sit against black.
     * Light: the same water at noon, pale enough that black body text
     * over the top of it stays comfortably above 4.5:1 — the waves are
     * behind prose on the docs pages, and pretty is not worth unreadable. */
    --sea-0: #0a4d63;
    --sea-0: light-dark(#bfe4ef, #0a4d63);
    --sea-1: #0a6480;
    --sea-1: light-dark(#a5d9e9, #0a6480);
    --sea-2: #067f9e;
    --sea-2: light-dark(#82c9e0, #067f9e);
    --sea-3: #00a2c4;
    --sea-3: light-dark(#5bb3d4, #00a2c4);
    --sea-deep: #00070e;
    --sea-deep: light-dark(#e8f2f6, #00070e);
    --sea-foam: #7fecff;
    --sea-foam: light-dark(#ffffff, #7fecff);
    --sea-glow: rgba(0, 194, 233, 0.16);
    --sea-glow: light-dark(rgba(10, 110, 133, 0.14), rgba(0, 194, 233, 0.16));
    --sea-glow-fade: rgba(0, 194, 233, 0);
    --sea-glow-fade: light-dark(rgba(10, 110, 133, 0), rgba(0, 194, 233, 0));

    /* The whale is a silhouette, so it only has to be darker than the
     * water on paper and lighter than the page on black. */
    --whale: #123f5c;
    --whale: light-dark(#3d92b5, #123f5c);
    --whale-lit: #00c2e9;
    --whale-lit: light-dark(#ffffff, #00c2e9);

    /* The night sky. Stars exist only over a black page — by day they
     * are simply not there, which is what fully-transparent light values
     * mean. waves.js reads these the same way it reads the sea, and
     * skips the whole star pass when the colour resolves to nothing.
     * Two tints because a real sky has them: most stars blue-white, a
     * scattering of warm ones. */
    --sky-star: #d6e6ff;
    --sky-star: light-dark(rgba(0, 0, 0, 0), #d6e6ff);
    --sky-star-warm: #ffe5b8;
    --sky-star-warm: light-dark(rgba(0, 0, 0, 0), #ffe5b8);
}

/* The toggle writes one of these onto <html>. `only` pins the scheme so
 * light-dark() stops consulting the OS. */
:root[data-theme='dark'] {
    color-scheme: only dark;
}

:root[data-theme='light'] {
    color-scheme: only light;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.72;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    /* The theme toggle swaps every colour on the page at once. Crossfaded
     * it reads as one deliberate change; instant it reads as a glitch. */
    transition: background-color var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease);
}

/* The org site's scan lines, dialled down. At full strength they fight
 * with body text; here they are texture you notice only if you look. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(0deg,
            var(--scanline) 0px,
            transparent 1px,
            transparent 3px);
}

.wrap {
    max-width: 62rem;
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
    z-index: 2;
}

/* ---------- header ---------- */

.masthead {
    border-bottom: 1px solid var(--line);
    background: var(--masthead-bg);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.masthead .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.brand .name {
    transition: color var(--dur-fast) var(--ease);
}

.brand .caret {
    color: var(--pink);
}

.brand .org {
    color: var(--muted);
}

.brand .name {
    color: var(--cyan);
    font-weight: 700;
}

.brand:hover .name {
    color: var(--pink);
}

.sitenav {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.sitenav a {
    color: var(--muted);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color var(--dur-fast) var(--ease), border-bottom-color var(--dur-fast) var(--ease);
}

.sitenav a:hover {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.sitenav a[aria-current='page'] {
    color: var(--text);
    border-bottom-color: var(--pink);
}

/* Theme toggle.
 *
 * A sun/moon pair can only say "light" or "dark", which leaves no way
 * back to "follow the system" once you have touched it. On a site set in
 * a monospace face the honest control is the word itself: it names the
 * state you are in and cycles auto -> light -> dark. Three states, no
 * legend needed.
 *
 * It ships hidden and JS unhides it, because a control that cannot do
 * anything without JS should not occupy space when there is none.
 */
.themetoggle {
    font: inherit;
    font-size: 0.85rem;
    line-height: inherit;
    color: var(--muted);
    background: none;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.themetoggle:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.themetoggle .val {
    color: var(--text);
}

.themetoggle[hidden] {
    display: none;
}

/* ---------- typography ---------- */

main {
    padding: 2.5rem 0 4rem;
}

/* The page surfaces once, briefly, on arrival — the same direction the
 * swell moves — and never again while you read. Reduced motion collapses
 * it to nothing via the global rule above. */
@keyframes surface {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

main .wrap {
    animation: surface var(--dur-slow) var(--ease) both;
}

h1,
h2,
h3 {
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.6rem, 4.5vw, 2.3rem);
    margin: 0 0 0.6rem;
    color: var(--text);
}

h2 {
    font-size: 1.15rem;
    margin: 3rem 0 1rem;
    color: var(--cyan);
    scroll-margin-top: 5rem;
}

h2::before {
    content: '## ';
    color: var(--line);
}

h3 {
    font-size: 1rem;
    margin: 2rem 0 0.6rem;
    color: var(--text);
    scroll-margin-top: 5rem;
}

h3::before {
    content: '### ';
    color: var(--line);
}

p,
ul,
ol {
    max-width: var(--measure);
}

p {
    margin: 0 0 1.1rem;
}

ul,
ol {
    padding-left: 1.3rem;
    margin: 0 0 1.1rem;
}

li {
    margin-bottom: 0.45rem;
}

li::marker {
    color: var(--pink);
}

a {
    color: var(--cyan);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color var(--dur-fast) var(--ease);
}

a:hover {
    color: var(--pink);
}

strong {
    color: var(--strong);
    font-weight: 700;
}

.lede {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: var(--measure);
    margin-bottom: 1.8rem;
}

.muted {
    color: var(--muted);
}

small,
.small {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- code ---------- */

code {
    font-family: inherit;
    font-size: 0.92em;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.08em 0.35em;
    color: var(--yellow);
    word-break: break-word;
}

pre {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 2px solid var(--cyan);
    padding: 0.95rem 1.1rem;
    overflow-x: auto;
    margin: 0 0 1.3rem;
    font-size: 0.86rem;
    line-height: 1.65;
}

pre code {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text);
    font-size: inherit;
}

/* Terminal transcript: a real session, not a mockup.
 *
 * These blocks stay dark in both themes, and that is deliberate. They are
 * a picture of a terminal, not page furniture — the same way a photograph
 * does not invert when the page does. The colours inside them are the
 * ANSI-ish set the CLI actually prints, calibrated against a dark
 * background; recolouring them for paper would make the screenshot a lie.
 * So .term carries its own fixed palette instead of the page tokens.
 */
.term {
    --term-bg: #0d0d0d;
    --term-bg-2: #141414;
    --term-line: #262626;
    --term-text: #e8e8e8;
    --term-muted: #9a9a9a;
    --term-cyan: #00c2e9;
    --term-pink: #e41478;
    --term-green: #00ff41;
    --term-yellow: #ffd53d;

    color-scheme: only dark;
    background: var(--term-bg);
    color: var(--term-text);
    border: 1px solid var(--term-line);
    margin: 0 0 1.5rem;
    overflow: hidden;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    background: var(--term-bg-2);
    border-bottom: 1px solid var(--term-line);
    font-size: 0.75rem;
    color: var(--term-muted);
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

.dot.r {
    background: var(--term-pink);
}

.dot.y {
    background: var(--term-yellow);
}

.dot.g {
    background: var(--term-green);
}

.term-bar .title {
    margin-left: 0.4rem;
}

.term pre {
    border: 0;
    margin: 0;
    background: none;
    color: var(--term-text);
}

.term code {
    background: none;
    border: 0;
    color: inherit;
}

.term .p {
    color: var(--term-green);
}

/* prompt $ */
.term .c {
    color: var(--term-muted);
}

/* comment / stderr status */
.term .o {
    color: var(--term-text);
}

/* stdout */
.term .k {
    color: var(--term-cyan);
}

/* keyword / flag */
.term .w {
    color: var(--term-yellow);
}

/* warn */

/* ---------- layout blocks ---------- */

.hero {
    padding: 1rem 0 0.5rem;
}

.hero h1 {
    font-size: clamp(1.9rem, 6vw, 3rem);
}

.hero h1 .caret {
    color: var(--pink);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.6rem;
}

.badges img {
    height: 20px;
    display: block;
}

.cta {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin: 1.6rem 0 0;
}

.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease);
}

.btn:hover {
    background: var(--cyan);
    color: var(--bg);
}

.btn.alt {
    border-color: var(--line);
    color: var(--muted);
}

.btn.alt:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--muted);
}

/* ---------- the sea ---------- */

/* One ocean, fixed to the viewport, behind every page. The content column
 * already carries z-index 2, so prose scrolls over water that does not
 * move with it — which is the point: the whole site sits on one sea
 * rather than each page carrying a decorative strip of it.
 *
 * The waves live in the bottom half and the whale is wider than the
 * screen, so the top of the viewport — where headings and the first
 * paragraph land — stays clean text on the page background.
 *
 * Before the canvas mounts, and forever with JS off, the same shape is
 * drawn with gradients and whale.svg. The canvas only ever upgrades
 * something already there. */
.sea {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    /* Nothing in here is content; a screen reader skips the lot. */
    contain: strict;
}

.sea-canvas {
    display: block;
    position: absolute;
    inset: 0;
    /* Never eats a click. waves.js tracks the pointer on the window
     * instead, which is also why the water answers the pointer anywhere
     * on the page rather than only where it is painted. */
    pointer-events: none;
}

/* Three separate declarations, not one stack of background layers: the
 * gradients need color-mix() and the whale does not, and a browser that
 * drops an invalid background-image drops the whole property. Split like
 * this, an engine without color-mix() loses the water and keeps a whale. */
.sea {
    --whale-img: url('whale.svg');
    background: linear-gradient(180deg,
            transparent 0%,
            transparent 56%,
            color-mix(in srgb, var(--sea-0) 30%, transparent) 62%,
            color-mix(in srgb, var(--sea-1) 42%, transparent) 70%,
            transparent 80%);
}

.sea::before,
.sea::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* The whale, sized and placed where the canvas would put it: wider than
 * the viewport, its own 55% waterline landing on the sea's. */
.sea::before {
    background: var(--whale-img) no-repeat 50% calc(78vh - 18.06vw) / 100% auto;
    opacity: 0.75;
}

/* ... and the near water washing over its belly. Same sandwich the canvas
 * builds; a whale on top of a flat gradient reads as a sticker. */
.sea::after {
    background: linear-gradient(180deg,
            transparent 76%,
            color-mix(in srgb, var(--sea-2) 52%, transparent) 81%,
            color-mix(in srgb, var(--sea-3) 72%, transparent) 89%,
            var(--sea-deep) 100%);
}

/* Once the canvas is up it owns the whole thing. */
.sea.is-live {
    background: none;
}

.sea.is-live::before,
.sea.is-live::after {
    display: none;
}

/* The footer sits on the water rather than on a rule. */
.foot {
    position: relative;
    z-index: 2;
}

@media print {
    .sea {
        display: none;
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
    max-width: none;
    padding: 0;
    list-style: none;
}

.card {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1.1rem 1.2rem;
    margin: 0;
    transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
        background-color var(--dur-slow) var(--ease);
}

/* Cards answer the pointer the way the nav does: the accent arrives, and
 * a lift small enough to feel rather than watch. */
.card:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--cyan);
}

.card h3::before {
    content: none;
}

.card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.card a {
    text-decoration: none;
}

.card p strong {
    color: var(--text);
}

/* ---------- tables ---------- */

.tablewrap {
    overflow-x: auto;
    margin: 0 0 1.5rem;
    border: 1px solid var(--line);
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
    min-width: 34rem;
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    transition: background-color var(--dur-fast) var(--ease);
}

/* A reading aid, not a control: rows light faintly under the pointer so
 * a wide table can be followed without a finger on the screen. */
tbody tr:hover td {
    background: var(--surface);
}

th {
    background: var(--surface-2);
    color: var(--cyan);
    font-weight: 700;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: 0;
}

td code {
    white-space: nowrap;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- callouts ---------- */

.note {
    border-left: 2px solid var(--purple);
    background: var(--surface);
    padding: 0.9rem 1.1rem;
    margin: 0 0 1.4rem;
    max-width: var(--measure);
}

.note p:last-child {
    margin-bottom: 0;
}

.note .tag {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 0.35rem;
}

.note.warn {
    border-left-color: var(--yellow);
}

.note.warn .tag {
    color: var(--yellow);
}

/* Status chips, mostly on the news page: the one fact about an
 * announcement that decides what you do with it, pinned next to it. */
.chip {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--purple);
    border: 1px solid currentColor;
    border-radius: 3px;
    padding: 0.05em 0.5em;
    margin-left: 0.5rem;
    vertical-align: 0.18em;
    white-space: nowrap;
}

.chip.warn {
    color: var(--yellow);
}

.chip.ok {
    color: var(--cyan);
}

/* ---------- breadcrumb + pager ---------- */

.crumb {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.crumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

.crumb a:hover {
    color: var(--cyan);
}

.crumb .sep {
    color: var(--line);
    margin: 0 0.4rem;
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3.5rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

.pager a {
    text-decoration: none;
}

.pager .lbl {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

/* ---------- footer ---------- */

.foot {
    border-top: 1px solid var(--line);
    padding: 1.8rem 0 2.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.foot .wrap {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.foot a {
    color: var(--muted);
    transition: color var(--dur-fast) var(--ease);
}

.foot a:hover {
    color: var(--cyan);
}

/* ---------- utility ---------- */

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 1rem;
    top: 0.5rem;
    z-index: 100;
    background: var(--cyan);
    color: var(--bg);
    padding: 0.5rem 0.9rem;
}

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

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .masthead .wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sitenav {
        gap: 0.85rem;
    }
}

@media print {

    body::before,
    .masthead,
    .pager {
        display: none;
    }

    /* Paper is paper regardless of what the screen was doing. Pin the
     * light scheme so a reader printing from dark mode does not get a
     * page of black ink, and flip the terminal blocks with it — on paper
     * they are text, not a picture of a screen. */
    :root,
    :root[data-theme='dark'],
    .term {
        color-scheme: only light;
    }

    body {
        background: #fff;
        color: #000;
    }

    .term {
        --term-bg: #fff;
        --term-bg-2: #f2f1ec;
        --term-line: #d4d1c7;
        --term-text: #17171a;
        --term-muted: #5a5a60;
        --term-cyan: #0a6e85;
        --term-pink: #bd0e60;
        --term-green: #0a6b2c;
        --term-yellow: #7a5200;
    }
}

/* ---------- playground ----------
 *
 * The one page that is an application rather than prose. It borrows the
 * .term palette for the transcript — a terminal should look like a
 * terminal in either theme — and follows the page theme for everything
 * the reader types into.
 *
 * The layout is two columns that collapse to one below 60rem. There is
 * no breakpoint tuning beyond that: the controls are a stack either way,
 * they just move.
 */

.pg-enrol {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1.25rem var(--gutter);
    margin: 0 0 2rem;
}

.pg-enrol p {
    max-width: var(--measure);
}

.pg-terms {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.25rem;
    font-size: 0.9rem;
}

.pg-terms li {
    display: flex;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--line);
}

.pg-terms li span:first-child {
    flex: none;
    width: 9rem;
    color: var(--muted);
}

.pg-status {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
    min-height: 1.2em;
}

/* Buttons and fields. The site has no form controls anywhere else, so
 * these are defined here rather than globally. */
.pg-enrol button,
.pg-app button {
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.pg-enrol button:hover,
.pg-app button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.pg-enrol button:disabled,
.pg-app button:disabled {
    opacity: 0.5;
    cursor: default;
    border-color: var(--line);
    color: var(--muted);
}

.pg-primary {
    border-color: var(--cyan) !important;
    color: var(--cyan) !important;
}

.pg-app input,
.pg-app select,
.pg-app textarea {
    font: inherit;
    font-size: 0.85rem;
    width: 100%;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 0.4rem 0.55rem;
    transition: border-color var(--dur-fast) var(--ease);
}

.pg-app input:hover,
.pg-app select:hover,
.pg-app textarea:hover {
    border-color: var(--muted);
}

.pg-app textarea {
    resize: vertical;
}

.pg-app input:focus,
.pg-app select:focus,
.pg-app textarea:focus {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

.pg-app label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.9rem 0 0.25rem;
}

/* Visually hidden, still announced. The composer's label is obvious to
 * anyone who can see the placeholder and invisible to anyone who cannot. */
.pg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pg-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: var(--gutter);
    margin: 0 0 2.5rem;
    align-items: start;
}

@media (max-width: 60rem) {
    .pg-app {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pg-log {
    min-height: 20rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.55;
}

.pg-log:empty::before {
    content: 'ready. ask it something.';
    color: var(--term-muted);
}

.pg-turn {
    margin: 0 0 1.1rem;
}

.pg-turn:last-child {
    margin-bottom: 0;
}

.pg-role {
    color: var(--term-cyan);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.pg-user .pg-role {
    color: var(--term-green);
}

.pg-body {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.pg-user .pg-body {
    color: var(--term-text);
}

/* Reasoning is collapsed by default. It is often longer than the answer
 * and is rarely what the reader came for — but hiding it entirely would
 * misrepresent what the model charged for. */
.pg-reasoning {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    color: var(--term-muted);
}

.pg-reasoning summary {
    cursor: pointer;
    color: var(--term-yellow);
}

.pg-reasoning pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0.4rem 0 0;
    padding-left: 0.8rem;
    border-left: 1px solid var(--term-line);
    color: var(--term-muted);
    font-size: 0.78rem;
    max-height: 14rem;
    overflow-y: auto;
}

.pg-footer {
    color: var(--term-muted);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.pg-composer {
    margin-top: 0.75rem;
}

.pg-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.pg-usage {
    color: var(--muted);
    font-size: 0.75rem;
    margin-left: auto;
}

.pg-error {
    border: 1px solid var(--pink);
    color: var(--pink);
    background: var(--surface);
    padding: 0.6rem 0.8rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.pg-side {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 0.25rem 1rem 1rem;
}

.pg-side h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 1.4rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.pg-side h2:first-child {
    border-top: 0;
    margin-top: 0.9rem;
    padding-top: 0;
}

.pg-note {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.4rem 0 0;
}

/* The command panel. This is the page's argument, so it gets the
 * terminal treatment rather than looking like another field. */
.pg-command {
    color-scheme: only dark;
    background: #0d0d0d;
    border: 1px solid #262626;
    color: #e8e8e8;
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0.7rem 0.8rem;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}
