SchOS/docs/niveus/examples/ai-chat/app.css
Nexoniarz 6490e5c759 site: rebuilt on Niveus, and the palette stops being a copy
Niveus is the interface language the project uses from here on -- this site
first, applications after it. Rebuilding the site on it is what proves the
system is one, rather than a folder of CSS with a README.

**`style.css` is gone.** 21 KB that transcribed include/theme.h by hand:
palette, type scale, shadows, spacing, every component. The intent was right --
"a site describing an operating system should look like the operating system"
-- and the mechanism was a copy, which means two files that have to be kept in
step by remembering to. What replaced it is `app.css`, which is layout and
nothing else, and one declaration in each page:

    :root { --nv-brand: #7C5CFF; }

That is SCH_ACCENT. Niveus derives the accent and its states, the link colour,
the focus ring, the tint in the greys and how far the status colours lean, for
light and dark both. One number to keep true instead of forty.

**The site is now adaptive.** Dark by default, because the OS is dark, with a
Light/Dark/Auto group in the bar that is real. The choice is kept in
localStorage and re-applied by an inline script before first paint, so the page
never renders in one appearance and corrects itself while you watch.

**PSOGM keeps its one purple, and now says so structurally.** #4B1D9A is
spelled the way Niveus spells a subtree with its own colour -- `data-nv-brand`
with its own `--nv-brand` on that section -- so every role inside re-derives
from it rather than being painted on. Still exactly one place, which is what
branding/README.md asks for.

Content is unchanged; what changed is what it is made of. Cards are `.nv-card`,
tags are `.nv-badge`, the support table is `.nv-table`, the crash section is a
`.nv-bed`, and the docs reader's two rails are `.nv-nav--vertical` with the
current document marked by `aria-current` rather than a class of our own.
`docs.js` emits `.nv-table` and `.nv-code`, so a change to the system reaches
the documentation too.

Three things were found by looking at it in a browser rather than by reading
it, and all three are the same mistake: **a `.nv-card` carries no padding of
its own -- its parts do.** The stat tiles, the "One ISO, one stick" band and
the card headers were all built from bare children, so numbers ran to the card
edge, the USB mark hung off it, and a title and its badge sat at opposite ends
of a row meant for a title and a trailing slot. Where the component had a right
way to say it, the markup now says it that way; where it did not -- a tile has
no parts -- `app.css` supplies the padding and says why.

Checked: every nv- class used across the three pages and docs.js exists in the
CSS, every token referenced by app.css is defined, and app.css contains no hex
value at all. Niveus's own tools/check.py passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 14:40:09 +02:00

234 lines
5.7 KiB
CSS

/* ==========================================================================
Lumen Chat — app layout
--------------------------------------------------------------------------
Layout only. The shell is a two-column grid pinned to the viewport, with
exactly one scrolling region; everything visual comes from Niveus.
The avatars below are the one place this app extends the system rather than
consuming it — and even then they are built from tokens, not from values
invented here. That is the correct way to extend: new shapes, old language.
========================================================================== */
html, body {
block-size: 100%;
}
body {
overflow: hidden; /* the transcript scrolls, the page does not */
}
.app {
display: grid;
grid-template-columns: 17rem 1fr;
block-size: 100svh;
}
@media (max-width: 52rem) {
.app {
grid-template-columns: 1fr;
}
.app__sidebar {
display: none;
}
}
/* --- Sidebar ---------------------------------------------------------------- */
.app__sidebar {
display: flex;
flex-direction: column;
gap: var(--nv-space-3);
min-block-size: 0;
padding: var(--nv-space-4) var(--nv-space-3);
background-color: var(--nv-color-background-subtle);
border-inline-end: var(--nv-border-width) solid var(--nv-color-border-subtle);
}
.app__threads {
flex: 1;
min-block-size: 0;
overflow-y: auto;
margin-inline: calc(var(--nv-space-1) * -1);
padding-inline: var(--nv-space-1);
}
.thread__title {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.thread__meta {
display: block;
font: var(--nv-font-caption);
color: var(--nv-color-text-tertiary);
font-weight: var(--nv-font-weight-regular);
}
/* This sidebar is a plain aside rather than .nv-nav--vertical, so the list
keeps its default row direction until told otherwise. */
.app__threads .nv-nav__list {
flex-direction: column;
align-items: stretch;
gap: var(--nv-space-0-5);
}
/* A nav item holding two lines needs to stop centring them. */
.app__threads .nv-nav__item {
align-items: flex-start;
flex-direction: column;
gap: 0;
min-inline-size: 0;
}
/* --- Main ------------------------------------------------------------------- */
.app__main {
display: grid;
grid-template-rows: auto 1fr auto;
min-block-size: 0;
min-inline-size: 0;
}
.app__transcript {
overflow-y: auto;
overscroll-behavior: contain;
padding: var(--nv-space-6) var(--nv-layout-gutter);
}
.transcript {
max-inline-size: 48rem;
margin-inline: auto;
display: flex;
flex-direction: column;
gap: var(--nv-space-6);
}
/* --- Messages ---------------------------------------------------------------- */
.message {
display: flex;
gap: var(--nv-space-3);
align-items: flex-start;
}
.message--from-user {
flex-direction: row-reverse;
}
.message__body {
max-inline-size: 42rem;
min-inline-size: 0;
}
.message--from-user .message__body {
padding: var(--nv-space-3) var(--nv-space-4);
background-color: var(--nv-color-accent-subtle);
border: var(--nv-border-width) solid var(--nv-color-accent-border);
border-radius: var(--nv-radius-lg);
border-end-end-radius: var(--nv-radius-xs);
color: var(--nv-color-text-primary);
}
.message__body > * + * {
margin-block-start: var(--nv-space-3);
}
.avatar {
inline-size: var(--nv-space-8);
block-size: var(--nv-space-8);
flex: none;
display: grid;
place-items: center;
border-radius: var(--nv-radius-full);
font: var(--nv-font-caption);
font-weight: var(--nv-font-weight-semibold);
border: var(--nv-border-width) solid var(--nv-color-border-subtle);
box-shadow: var(--nv-highlight-top), var(--nv-elevation-1);
}
.avatar--agent {
background-color: var(--nv-color-accent);
color: var(--nv-color-on-accent);
border-color: transparent;
}
.avatar--user {
background-color: var(--nv-color-surface-elevated);
color: var(--nv-color-text-secondary);
}
.code-block {
display: block;
padding: var(--nv-space-4);
border-radius: var(--nv-radius-md);
background-color: var(--nv-color-surface-inset);
border: var(--nv-border-width) solid var(--nv-color-border-subtle);
box-shadow: var(--nv-elevation-inset-sm);
overflow-x: auto;
white-space: pre;
}
/* The three dots while an answer is still arriving. */
.thinking {
display: inline-flex;
gap: var(--nv-space-1);
align-items: center;
padding-block: var(--nv-space-2);
}
.thinking span {
inline-size: var(--nv-space-1-5);
block-size: var(--nv-space-1-5);
border-radius: var(--nv-radius-full);
background-color: var(--nv-color-text-tertiary);
animation: thinking 1.2s var(--nv-ease-standard) infinite;
}
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes thinking {
0%, 60%, 100% { opacity: 0.25; translate: 0 0; }
30% { opacity: 1; translate: 0 calc(var(--nv-travel-sm) * -0.5); }
}
@media (prefers-reduced-motion: reduce) {
.thinking span { animation: none; opacity: 0.5; }
}
/* --- Composer ----------------------------------------------------------------- */
.composer {
padding: var(--nv-space-4) var(--nv-layout-gutter) var(--nv-space-5);
border-block-start: var(--nv-border-width) solid var(--nv-color-border-subtle);
background-color: var(--nv-color-background);
}
.composer__inner {
max-inline-size: 48rem;
margin-inline: auto;
display: flex;
flex-direction: column;
gap: var(--nv-space-2-5);
}
.composer__row {
display: flex;
align-items: flex-end;
gap: var(--nv-space-2);
}
.composer__row .nv-input {
min-block-size: var(--nv-control-height-lg);
max-block-size: 9rem;
}
.composer__hints {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--nv-space-4);
}