mirror of
https://github.com/bitbaum/substrata.git
synced 2026-12-04 05:07:46 +01:00
* feat(company): quote first on a listed company; Ask pill never covers a figure - A listed company reads like a quote page: name, quote, then the share price's range row and chart. Its role in the chain (the lede, the five tiles at a glance, why it is graded so, where the role is cited, and the update news) moves below Key statistics as "Role in the chain" (section id chain-role; `role` is already the "What this holds up" module). Unlisted, identified and stub companies are unchanged. - From 768px the page column keeps a right gutter as wide as the floating Ask pill, which sat on NVIDIA's "Largest fall from a peak" at 1440px. - On a phone the floating pill is hidden again: Ask is the top-bar button there. The rule was lost in the chatkit move (#140), leaving two Asks and the pill over the same figure at 390px. - docs/design/company-page.md follows the new order and the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE * feat(company): a year of closes is a clean line with a light fill chartkit 0.3.0 (LineChart markers + area): the price chart passes markers="auto" and area, so a range of more than 60 closes draws no dot per close (about 120 beads on 1Y before); each close still shows its value on hover and keyboard focus, and the table holds them all. Short ranges (1M) keep their dots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE --------- Co-authored-by: Claude <noreply@anthropic.com>
495 lines
13 KiB
CSS
495 lines
13 KiB
CSS
/*
|
|
* Ask: the floating dock (on every page), the page, and Substrata's own parts
|
|
* around @bitbaum/chatkit — the evidence under an answer, the model control,
|
|
* the empty state. How a chat behaves and looks is chatkit's (globals.css maps
|
|
* its colours); nothing here restyles chatkit's own elements.
|
|
*/
|
|
.ask-dock {
|
|
position: fixed;
|
|
right: 1.25rem;
|
|
/* Above the phone's tab bar; 0 from 768px up (--shell-offset-bottom). */
|
|
bottom: calc(var(--shell-offset-bottom) + 1.25rem);
|
|
z-index: 50;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
/* The pill floats over every page but the front page and /chat. At the end of
|
|
a page it would sit on the last lines (a company page's sources, 2026-10-27),
|
|
so the footer keeps room for it (from 768px; a phone has no pill). */
|
|
@media (min-width: 768px) {
|
|
body:has(.ask-dock-toggle) .site-footer {
|
|
padding-bottom: calc(var(--widget-reserve, 0px) + 4.5rem);
|
|
}
|
|
}
|
|
|
|
/* From 768px the pill floats beside the page column, not over it: the column
|
|
keeps a right gutter as wide as the pill and its offset (1.25rem + a 4rem
|
|
pill + 0.75rem), so no figure scrolls under it. Without it the pill sat on
|
|
NVIDIA's "Largest fall from a peak" figure at 1440px (2026-10-27). A phone
|
|
has no gutter to spare, and no pill: see below. */
|
|
@media (min-width: 768px) {
|
|
body:has(.ask-dock-toggle) .page-column {
|
|
padding-right: 6rem;
|
|
}
|
|
}
|
|
|
|
/* Phones: Ask is the top-bar button (TopBar .shell-ask); a floating pill here
|
|
covers the text above the tab bar — it sat on NVIDIA's "Largest fall from a
|
|
peak" at 390px. This rule was lost when Ask moved to chatkit (#140), which
|
|
left two Asks on every phone page. The panel still opens from the bar. */
|
|
@media (max-width: 767px) {
|
|
.ask-dock-toggle {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
.ask-dock-toggle {
|
|
min-height: 3rem;
|
|
min-width: 3rem;
|
|
padding: 0 1.1rem;
|
|
border-radius: 999px;
|
|
background: var(--color-fg-primary);
|
|
color: var(--color-surface-page);
|
|
font-weight: 650;
|
|
letter-spacing: 0.08em;
|
|
text-transform: uppercase;
|
|
font-size: 0.8rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/*
|
|
* The panel over a page (AskPanel): on a phone a sheet from the bottom edge,
|
|
* 92% of the visual viewport, with a grip to pull it down; from 768px a
|
|
* panel on the right, full height. The conversation inside is chatkit's
|
|
* ChatScreen, which owns the scrolling; this owns the edges. `--ck-viewport-
|
|
* height` is set on the sheet by chatkit's useViewportHeight, so the sheet
|
|
* shrinks to the room above a phone keyboard and the composer rides on it.
|
|
*/
|
|
.ask-sheet-root {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 60;
|
|
pointer-events: none;
|
|
}
|
|
.ask-sheet-root[hidden] {
|
|
display: none;
|
|
}
|
|
.ask-sheet-scrim {
|
|
position: absolute;
|
|
inset: 0;
|
|
background: var(--color-scrim);
|
|
pointer-events: auto;
|
|
}
|
|
.ask-sheet {
|
|
position: absolute;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
pointer-events: auto;
|
|
background: var(--color-surface-page);
|
|
box-shadow: var(--shadow-overlay);
|
|
transition: transform 0.18s ease-out;
|
|
}
|
|
/* The grip: a bar in the sheet's top edge, the pull area the strip above the
|
|
title row, edge to edge — never over Expand or Close, which on a 320px
|
|
phone sit where a centred 44px area would land. */
|
|
.ask-sheet-grip {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 1;
|
|
height: 1rem;
|
|
background: none;
|
|
cursor: grab;
|
|
touch-action: none;
|
|
}
|
|
.ask-sheet-grip::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0.4rem;
|
|
left: 50%;
|
|
width: 2.5rem;
|
|
height: 0.3rem;
|
|
border-radius: 999px;
|
|
background: var(--color-border-strong);
|
|
transform: translateX(-50%);
|
|
}
|
|
.ask-sheet-head {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 0.5rem;
|
|
min-height: var(--size-target);
|
|
padding: 1rem 0.25rem 0 1rem;
|
|
border-bottom: 1px solid var(--color-border-subtle);
|
|
}
|
|
.ask-sheet-head h2 {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font: 600 1rem/1.2 var(--font-heading);
|
|
letter-spacing: var(--tracking-display);
|
|
color: var(--color-fg-primary);
|
|
}
|
|
.ask-sheet-actions {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
}
|
|
.ask-sheet-actions button {
|
|
min-height: var(--size-target);
|
|
min-width: var(--size-target);
|
|
padding: 0 0.75rem;
|
|
border-radius: 0.375rem;
|
|
color: var(--color-fg-secondary);
|
|
font-size: 0.9rem;
|
|
cursor: pointer;
|
|
}
|
|
.ask-sheet-actions button:hover {
|
|
background: var(--color-surface-raised);
|
|
color: var(--color-fg-primary);
|
|
}
|
|
.ask-sheet-body {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
}
|
|
/* A chart in an answer (chartkit's figure, drawn by chat/chartRenderers.tsx)
|
|
is a block of its own, set apart from the sentences around it. */
|
|
.companion .ck-chart {
|
|
margin-block: 1rem;
|
|
}
|
|
/* chatkit's text box is 40px tall; every control in a chat here is a full
|
|
target (as on the home page's Ask box). */
|
|
.companion .ck-input {
|
|
min-height: var(--size-target);
|
|
}
|
|
/* chatkit's ChatApp fills its frame: the sheet's body, or /chat's page. */
|
|
.companion {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
}
|
|
.companion > .ck-app {
|
|
flex: 1;
|
|
min-height: 0;
|
|
}
|
|
.ask-sheet-body > .companion {
|
|
height: auto;
|
|
}
|
|
@media (max-width: 767.98px) {
|
|
.ask-sheet {
|
|
right: 0;
|
|
left: 0;
|
|
top: calc(var(--ck-viewport-height, 100dvh) * 0.08);
|
|
height: calc(var(--ck-viewport-height, 100dvh) * 0.92);
|
|
border-top: 1px solid var(--color-border-strong);
|
|
border-radius: 1rem 1rem 0 0;
|
|
animation: ask-rise 0.2s ease-out;
|
|
}
|
|
/* The page does not scroll behind the sheet. */
|
|
html.ask-sheet-open {
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
@media (min-width: 768px) {
|
|
.ask-sheet-scrim,
|
|
.ask-sheet-grip {
|
|
display: none;
|
|
}
|
|
.ask-sheet {
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: min(30rem, 100vw);
|
|
border-left: 1px solid var(--color-border-strong);
|
|
animation: ask-slide 0.2s ease-out;
|
|
}
|
|
.ask-sheet-head {
|
|
padding-top: 0;
|
|
}
|
|
}
|
|
@keyframes ask-rise {
|
|
from {
|
|
transform: translateY(2rem);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
@keyframes ask-slide {
|
|
from {
|
|
transform: translateX(2rem);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.ask-sheet {
|
|
animation: none;
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* /chat is the fleet's whole-screen chat: chatkit's ChatScreen (as on Loki
|
|
* and Solon). It owns the heights — the visual viewport that shrinks under a
|
|
* phone keyboard, the measured header and composer insets the thread pads
|
|
* itself with — so nothing here computes a height. What the page adds is the
|
|
* shell around it: the column never scrolls (the thread is the only
|
|
* scroller), and on a phone the site's top bar and tab bar step aside so the
|
|
* conversation has the whole display; the floating header's pill is the way
|
|
* back. From 768px up the top bar stays and the screen takes the rest.
|
|
*/
|
|
.shell.is-chat .shell-column {
|
|
min-height: 0;
|
|
height: 100dvh;
|
|
overflow: hidden;
|
|
}
|
|
.shell.is-chat .shell-page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
}
|
|
.companion-page {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
min-width: 0;
|
|
}
|
|
@media (max-width: 767.98px) {
|
|
.shell.is-chat .shell-topbar,
|
|
.shell.is-chat .shell-tabbar {
|
|
display: none;
|
|
}
|
|
.shell.is-chat .shell-column {
|
|
padding-bottom: 0;
|
|
}
|
|
}
|
|
@media (min-width: 768px) {
|
|
.companion-page .ck-app-viewport {
|
|
height: calc(var(--ck-viewport-height, 100dvh) - var(--spacing-topbar));
|
|
}
|
|
}
|
|
|
|
/* The floating header: the way back as a frosted pill, the page's name beside it. */
|
|
.companion-title {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font: 600 1rem/1.2 var(--font-heading);
|
|
letter-spacing: var(--tracking-display);
|
|
color: var(--color-fg-primary);
|
|
}
|
|
|
|
/* The empty state is a direct child of the screen body (chatkit renders
|
|
`empty` in the thread's place): it scrolls under the floating header and
|
|
composer with the measured insets as its padding, in the reading column. */
|
|
.companion .ck-screen-body > .ask-empty {
|
|
flex: 1;
|
|
width: 100%;
|
|
max-width: calc(var(--ck-measure) + 2 * var(--ck-gutter));
|
|
margin-inline: auto;
|
|
min-height: 0;
|
|
padding: calc(var(--ck-top-inset, 0px) + 1rem) var(--ck-gutter)
|
|
calc(var(--ck-bottom-inset, 0px) + 1rem);
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* With the composer, in the dock: the key panel and "Send evidence". It can
|
|
outgrow a short phone, so it scrolls inside the dock rather than pushing
|
|
the composer off the screen. */
|
|
.companion-beside {
|
|
max-height: 40dvh;
|
|
overflow-y: auto;
|
|
}
|
|
.companion-beside:empty {
|
|
display: none;
|
|
}
|
|
.companion-beside .ask-aside {
|
|
margin-top: 0;
|
|
text-align: center;
|
|
}
|
|
|
|
/* In the panel the empty state is shorter: no headline, the starters at once. */
|
|
.companion.is-compact .ask-empty {
|
|
padding-top: 0.5rem;
|
|
}
|
|
|
|
.ask-empty {
|
|
padding: 1.5rem 0 1rem;
|
|
}
|
|
.ask-empty h2 {
|
|
font: 600 clamp(1.4rem, 4vw, 1.9rem) / 1.2 var(--font-heading);
|
|
letter-spacing: var(--tracking-display);
|
|
color: var(--color-fg-primary);
|
|
}
|
|
.ask-cta {
|
|
margin: 0.75rem 0 0.5rem;
|
|
}
|
|
.ask-cta-button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: var(--size-target);
|
|
padding: 0.55rem 1.15rem;
|
|
border-radius: var(--ck-radius-sm, 0.4rem);
|
|
background: var(--color-fg-primary);
|
|
color: var(--color-surface-page);
|
|
font: 500 0.9rem var(--font-sans);
|
|
border: 1px solid var(--color-fg-primary);
|
|
cursor: pointer;
|
|
transition: opacity 0.15s ease;
|
|
}
|
|
.ask-cta-button:hover {
|
|
opacity: 0.88;
|
|
}
|
|
.ask-empty p {
|
|
margin: 0.6rem 0 1.2rem;
|
|
max-width: 34rem;
|
|
color: var(--color-fg-secondary);
|
|
line-height: 1.55;
|
|
}
|
|
|
|
/* Composer tools: one height, one weight, no borders of their own. */
|
|
.ask-tool {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
min-height: var(--size-target);
|
|
padding: 0 0.6rem;
|
|
border-radius: 0.4rem;
|
|
font-size: 0.85rem;
|
|
color: var(--color-fg-secondary);
|
|
cursor: pointer;
|
|
}
|
|
.ask-tool:hover {
|
|
color: var(--color-fg-primary);
|
|
background: var(--color-surface-raised);
|
|
}
|
|
/* The key panel, opened from the footnote: the shared models for a reader
|
|
without a key, then the key itself. */
|
|
.ask-key {
|
|
display: grid;
|
|
gap: 0.75rem;
|
|
padding: 0.75rem;
|
|
border: 1px solid var(--color-border-subtle);
|
|
border-radius: var(--ck-radius-sm, 0.4rem);
|
|
background: var(--color-surface-raised);
|
|
}
|
|
.ask-model-select {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.6rem;
|
|
font-size: 0.85rem;
|
|
color: var(--color-fg-secondary);
|
|
}
|
|
.ask-model-select select {
|
|
flex: 1;
|
|
min-height: var(--size-target);
|
|
padding: 0.4rem 0.5rem;
|
|
border: 1px solid var(--color-border-strong);
|
|
border-radius: var(--ck-radius-sm, 0.4rem);
|
|
background: var(--color-surface-page);
|
|
color: var(--color-fg-primary);
|
|
font: inherit;
|
|
font-size: 0.85rem;
|
|
cursor: pointer;
|
|
}
|
|
/* "Use your own AI key" in the one line under the composer: a link in a
|
|
sentence with a 44px thumb — the hit area grows, the line does not. */
|
|
.ask-footnote-button {
|
|
padding-block: 0.8rem;
|
|
margin-block: -0.8rem;
|
|
color: inherit;
|
|
text-decoration: underline;
|
|
text-underline-offset: 0.2em;
|
|
cursor: pointer;
|
|
}
|
|
.ask-footnote-button:hover {
|
|
color: var(--color-fg-primary);
|
|
}
|
|
|
|
.ask-aside {
|
|
margin-top: 0.5rem;
|
|
font-size: 0.8rem;
|
|
color: var(--color-fg-tertiary);
|
|
}
|
|
.ask-aside button {
|
|
/* A link in a sentence with a 44px thumb: the hit area grows, the line does not. */
|
|
padding-block: 0.8rem;
|
|
margin-block: -0.8rem;
|
|
text-decoration: underline;
|
|
text-underline-offset: 0.2em;
|
|
cursor: pointer;
|
|
}
|
|
.ask-aside button:hover {
|
|
color: var(--color-fg-primary);
|
|
}
|
|
|
|
/* Under an answer: its evidence, folded; three registers that never merge. */
|
|
.answer-footer {
|
|
display: grid;
|
|
gap: 0.35rem;
|
|
margin-top: 0.5rem;
|
|
font-size: 0.85rem;
|
|
color: var(--color-fg-secondary);
|
|
}
|
|
.answer-tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.4rem;
|
|
}
|
|
.answer-tag,
|
|
.answer-verdict {
|
|
padding: 0.1rem 0.5rem;
|
|
border: 1px solid var(--color-border-strong);
|
|
border-radius: 999px;
|
|
font-size: 0.75rem;
|
|
}
|
|
.answer-verdict.is-supported {
|
|
border-color: var(--color-status-positive);
|
|
}
|
|
.answer-verdict.is-contradicted {
|
|
border-color: var(--color-status-negative);
|
|
}
|
|
.answer-verdict.is-outdated,
|
|
.answer-verdict.is-unverifiable {
|
|
border-color: var(--color-status-warning);
|
|
}
|
|
.answer-block summary {
|
|
min-height: var(--size-target);
|
|
display: flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
color: var(--color-fg-secondary);
|
|
}
|
|
.answer-block summary:hover {
|
|
color: var(--color-fg-primary);
|
|
}
|
|
.answer-block ul {
|
|
display: grid;
|
|
gap: 0.4rem;
|
|
padding: 0 0 0.5rem 1rem;
|
|
}
|
|
.answer-block a {
|
|
color: var(--color-fg-primary);
|
|
text-decoration: underline;
|
|
text-underline-offset: 0.2em;
|
|
}
|
|
.answer-block blockquote {
|
|
margin: 0.25rem 0 0;
|
|
padding-left: 0.6rem;
|
|
border-left: 2px solid var(--color-border-strong);
|
|
color: var(--color-fg-tertiary);
|
|
}
|
|
.answer-evidence {
|
|
color: var(--color-fg-tertiary);
|
|
}
|