Spaces:
Running
Running
Download static/css/discover.css from Arrechenash/stocks: direct link, hf CLI and curl.
- Browser
- Download file 37.7 kB
-
https://huggingface.co/spaces/Arrechenash/stocks/resolve/main/static/css/discover.css
- Command line
-
hf download hf://spaces/Arrechenash/stocks/static/css/discover.css
-
curl -L -o discover.css https://huggingface.co/spaces/Arrechenash/stocks/resolve/main/static/css/discover.css
37.7 kB
/* ββββββββββββββββββββββββββββββββββββββββββββ
Discover Page β Specific Styles
ββββββββββββββββββββββββββββββββββββββββββββ */
/* ββ Group tints ββ
The colour that ties a row in the list to the group card that claims it. A run
returns at most twelve groups and this hands out eight, so a long run has two
groups sharing a hue; the cards are ordered biggest group first, so that is
also why the repeat lands on the two smallest. Written as RGB triplets rather
than colours because every consumer wants the same tint at its own alpha β a
55% rail on a row and a 70% border on a card are the same hue, and spelling
that hue twice as a hex would let the two drift apart.
`:root` rather than a page-scoped selector, as in research.css and
dilution.css: the tints are inert until a rule below maps one onto
`--group-tint-rgb`, and only this file's classes are ever given one. */
:root {
--discover-group-tint-1: 96, 165, 250;
--discover-group-tint-2: 45, 212, 191;
--discover-group-tint-3: 167, 139, 250;
--discover-group-tint-4: 250, 204, 21;
--discover-group-tint-5: 244, 114, 182;
--discover-group-tint-6: 132, 204, 22;
--discover-group-tint-7: 249, 115, 22;
--discover-group-tint-8: 56, 189, 248;
}
.discover-group-tint-1 { --group-tint-rgb: var(--discover-group-tint-1); }
.discover-group-tint-2 { --group-tint-rgb: var(--discover-group-tint-2); }
.discover-group-tint-3 { --group-tint-rgb: var(--discover-group-tint-3); }
.discover-group-tint-4 { --group-tint-rgb: var(--discover-group-tint-4); }
.discover-group-tint-5 { --group-tint-rgb: var(--discover-group-tint-5); }
.discover-group-tint-6 { --group-tint-rgb: var(--discover-group-tint-6); }
.discover-group-tint-7 { --group-tint-rgb: var(--discover-group-tint-7); }
.discover-group-tint-8 { --group-tint-rgb: var(--discover-group-tint-8); }
/* ββ Control panel toolbar ββ
Everything the toolbar holds is normalised to --control-height so the
row reads as one aligned strip. Without this the row was as tall as
its tallest member (the session <select>, 35px) while its other
controls floated at 16.5 / 24 / 28 / 29 / 33px inside it. Only
dimensions are overridden here β the shared component rules in
common.css stay the single owner of everything else. */
.control-panel--compact .control-panel__main {
--control-h: var(--control-height);
gap: var(--space-xs);
}
.control-panel--compact .control-panel__main > * {
flex: 0 0 auto;
}
/* Generous width on the session select pays for itself: it is the only
control whose caption changes length ("1W Gainers" / "Afterhours"). */
.control-panel--compact #discover-session {
height: var(--control-h);
padding: 0 var(--space-sm);
min-width: 11em;
}
/* The compact panel only follows the control-height token, which steps up
on touch widths; button padding and font come from the shared .btn. */
.control-panel--compact .btn {
height: var(--control-h);
}
/* The AI prompt is an editable field, so it needs a readable width without
taking the row over; it shares the toolbar's control height. */
.control-panel--compact .discover-ai-prompt {
height: var(--control-h);
width: clamp(13em, 22vw, 24em);
min-width: 0;
}
/* Segment controls are their own bordered strips; equalise the strip
height and the buttons inside it so both edges line up with the
buttons beside them. */
.control-panel--compact .view-toggle,
.control-panel--compact .tf-selector {
height: var(--control-h);
padding: var(--space-2xs);
gap: var(--space-2xs);
}
.control-panel--compact .view-toggle .view-btn,
.control-panel--compact .tf-selector .tf-btn {
height: calc(var(--control-h) - var(--table-cell-pad-y));
padding: 0 var(--space-sm);
display: inline-flex;
align-items: center;
}
.control-panel--compact .control-panel__toggle {
height: var(--control-h);
padding: 0 var(--space-sm);
align-self: center;
}
/* The count badge is plain text, so it has no box to align β give it the
control height and a floor width. Its caption changes with the fetch
("Initializing..." β "50 STOCKS FOUND" β "SCANNING..."); without the
floor every caption change shifts the whole toolbar sideways. */
.discover-count-badge {
display: flex;
align-items: center;
height: var(--control-h, var(--control-height));
min-width: 11em;
font-size: var(--font-xs);
font-weight: 600;
color: var(--text-secondary);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
/* The collapsible panels wrap a single child that already carries its own
padding (.column-picker / .presets-panel), so the shared secondary's
padding-top would stack a second 8px on top of it. The margin + border
are kept as the separator. */
.control-panel--compact .control-panel__secondary {
padding-top: 0;
}
/* ββ Column Picker (shared with scanner via ListView) ββ */
.column-picker {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs);
padding: var(--space-sm) var(--space-sm-plus);
}
.column-picker label {
display: flex;
align-items: center;
gap: var(--space-xs-plus);
padding: var(--space-xs) 10px;
font-size: var(--font-xs);
color: var(--text-secondary);
cursor: pointer;
border-radius: var(--radius-md);
background: var(--surface);
transition:
background var(--transition-base),
color var(--transition-base);
user-select: none;
}
.column-picker label:hover {
background: var(--surface-raised);
color: var(--text);
}
.column-picker label:has(input:checked) {
background: var(--primary);
color: var(--bg);
}
.column-picker label.column-picker__disabled {
opacity: 0.45;
cursor: not-allowed;
}
.column-picker label.column-picker__disabled:hover {
background: var(--surface);
color: var(--text-secondary);
}
.column-picker input {
display: none;
}
/* ββ Custom Filters ββ */
.custom-filters {
padding: var(--space-sm) var(--space-sm-plus) var(--space-xs);
display: flex;
flex-direction: column;
gap: var(--space-xs-plus);
}
/* .filter-row base layout and the compact field geometry live in common.css
(.input-field--sm); what is this page's is the surface the row's fields sit
on and the one control height they all share. */
.filter-row select,
.filter-row input {
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: var(--text);
height: var(--control-height);
/* The row packs three fields and an operator into one line, so its type
is a step below the compact geometry's. Typography is the page's to
choose; padding and border are the base's. */
font-size: var(--font-xs);
}
.filter-row select.filter-col {
width: 140px;
}
.filter-row select.filter-op {
width: 74px;
}
.filter-row input.filter-val {
width: 150px;
}
/* The between form splits one column into a min/max pair, so each input gets
less room than the single-value field. */
.filter-row input.filter-val-min,
.filter-row input.filter-val-max {
width: 68px;
}
.filter-remove {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: var(--space-xs) var(--space-xs-plus);
font-size: var(--font-icon);
line-height: 1;
}
.filter-remove:hover {
color: var(--danger);
}
/* ββ Presets Panel ββ
auto-fill (not auto-fit) so the columns keep a stable width as presets
are added or deleted β the section titles below stay aligned with the
list instead of re-flowing on every save. */
.presets-panel {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(14em, 1fr));
align-content: start;
gap: var(--space-2xs) var(--space-sm);
padding: var(--space-sm) var(--space-sm-plus);
width: 100%;
}
.presets-section-title,
.preset-save-btn {
grid-column: 1 / -1;
}
.presets-section-title {
font-size: var(--font-xs);
color: var(--text-muted);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
padding: var(--space-xs-plus) 0 var(--space-xs);
}
.presets-section-title:first-child {
padding-top: 0;
}
.preset-save-btn {
margin-top: var(--space-xs-plus);
width: 100%;
text-align: center;
padding: var(--space-xs-plus) var(--space-sm-plus);
font-size: var(--font-xs);
}
/* ββ Group summary ββ
The answer to a Discover run, stated where the run happened. It is a
page-level block rather than a dialog header because the result is the
point of the page, and it carries the coverage beside the finding: a
group read from a third of the list is not the same answer as one read
from all of it, and the two must not look alike. */
.discover-group-summary {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-md);
padding: var(--space-sm) var(--space-md);
background: var(--surface);
border: 1px solid var(--border);
border-left: 3px solid var(--accent);
border-radius: var(--radius-md);
}
.discover-group-summary__body {
display: flex;
flex-direction: column;
gap: var(--space-2xs);
min-width: 0;
}
.discover-group-summary__title {
color: var(--text);
font-size: var(--font-sm);
font-weight: 600;
}
.discover-group-summary__counts {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs) var(--space-md);
color: var(--text-muted);
font-size: var(--font-xs);
}
.discover-group-summary__counts strong {
color: var(--accent);
font-size: var(--font-sm);
}
.discover-group-summary__context {
color: var(--text-secondary);
font-size: var(--font-xs);
}
.discover-group-summary__actions {
display: flex;
flex-wrap: wrap;
flex-shrink: 0;
gap: var(--space-xs);
}
/* The block only appears for a run that has not produced a clean answer -- it
is in flight, the universe was too small, the descriptions could not be read,
only part of the list was read, or it failed. A run that found groups is
carried by the group section itself and does not raise this block at all, so
none of the visible states earns the accent rail: an unfinished run and an
unread universe are both "no answer yet", and a partial one is a finding that
is not finished. */
.discover-group-summary--loading,
.discover-group-summary--warming,
.discover-group-summary--universe-too-small,
.discover-group-summary--unread,
.discover-group-summary--no-common-ground {
border-left-color: var(--text-muted);
}
.discover-group-summary--loading .discover-group-summary__title,
.discover-group-summary--warming .discover-group-summary__title,
.discover-group-summary--universe-too-small .discover-group-summary__title,
.discover-group-summary--unread .discover-group-summary__title,
.discover-group-summary--no-common-ground .discover-group-summary__title {
color: var(--text-secondary);
}
/* A partial answer keeps the accent β it did find groups β but says so in the
same accent rather than a second, louder colour. */
.discover-group-summary--partial {
border-left-color: var(--warning);
}
.discover-group-summary--error {
border-left-color: var(--danger);
background: var(--negative-bg);
}
.discover-group-summary--error .discover-group-summary__title {
color: var(--danger);
}
/* ββ Group section ββ
A native <details>, so it is collapsed on every render, needs no open
state to keep in sync, and is reachable by keyboard and by the browser's
own find-in-page for free. */
.discover-groups {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
}
.discover-groups__summary {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: var(--space-xs) var(--space-sm);
padding: var(--space-sm) var(--space-md);
cursor: pointer;
}
.discover-groups__summary:hover .discover-groups__summary-label {
color: var(--accent);
}
.discover-groups__summary-label {
color: var(--text);
font-family: var(--font-heading);
font-size: var(--font-sm);
font-weight: 600;
}
.discover-groups__summary-meta {
color: var(--text-muted);
font-size: var(--font-xs);
}
.discover-groups__body {
display: grid;
gap: var(--space-sm);
padding: 0 var(--space-md) var(--space-md);
}
/* The only caveat the list needs in prose: how much of the screen was not read.
Empty when coverage is complete, so it costs nothing on a full read. */
.discover-groups__note {
margin: 0;
max-width: 80ch;
color: var(--text-muted);
font-size: var(--font-xs);
line-height: 1.4;
}
.discover-groups__note:empty {
display: none;
}
/* The groups sit side by side rather than stacked. Stacked, each card was 1318px
wide holding a handful of chips and two numbers, and three of them cost 660px
of height on top of a list that is the page's actual subject. A run of narrow
columns spends the width the page has plenty of and buys back the height it
does not. */
.discover-groups__list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
align-items: start;
gap: var(--space-sm);
}
/* ββ Group cards ββ
One card per group, leading with the words it was defined by and the
companies that share them. There is deliberately no score block, no bar
and no priority label anywhere in here: a single filled track beside a
group reads as a grade, and grouping descriptions does not produce
grades. */
.discover-group {
display: grid;
gap: var(--space-sm);
padding: var(--space-md);
background: var(--surface);
border: 1px solid var(--border);
border-left: 3px solid rgb(var(--group-tint-rgb, 42 46 57), 70%);
border-radius: var(--radius-lg);
}
.discover-group__head {
display: grid;
gap: var(--space-2xs);
min-width: 0;
}
.discover-group__label {
margin: 0;
color: var(--text);
font-family: var(--font-heading);
font-size: var(--font-lg);
font-weight: 600;
line-height: 1.2;
overflow-wrap: anywhere;
}
/* Why the label reads the way it does, and only when it is the answer worth
giving: a curated theme is provenance the card cannot show otherwise. The
other source is the chips below it, so the line stays off entirely. */
.discover-group__naming {
margin: 0;
color: var(--text-muted);
font-size: var(--font-xxs);
letter-spacing: 0.06em;
text-transform: uppercase;
}
.discover-group__terms {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs);
margin: 0;
padding: 0;
list-style: none;
}
.discover-group__term {
padding: var(--space-2xs) var(--space-xs);
border: 1px solid var(--border-focus);
border-radius: var(--radius-sm);
background: var(--bg);
color: var(--text);
font-size: var(--font-xs);
line-height: 1.2;
}
.discover-group__members {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-xs);
margin: 0;
padding: 0;
list-style: none;
}
.discover-group__member-count {
color: var(--text-muted);
font-size: var(--font-xs);
}
.discover-group__member {
display: inline-flex;
align-items: baseline;
gap: var(--space-xs);
padding: var(--space-2xs) var(--space-xs);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg);
font-size: var(--font-xs);
line-height: 1.2;
white-space: nowrap;
}
.discover-group__member-symbol {
color: var(--text);
font-family: var(--font-mono);
font-weight: 600;
text-decoration: none;
}
.discover-group__member-symbol:hover {
color: var(--accent);
text-decoration: underline;
}
.discover-group__value--up {
color: var(--positive);
}
.discover-group__value--down {
color: var(--negative);
}
/* The two measurements that are shown, as words with their numbers
alongside. Both may read badly β a group whose words the rest of the
list uses too is still a true reading β so neither is dressed as a
score. */
.discover-group__wording {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs) var(--space-md);
margin: 0;
padding-top: var(--space-sm);
border-top: 1px solid var(--border);
}
.discover-group__measure {
display: inline-flex;
align-items: baseline;
gap: var(--space-xs);
color: var(--text-muted);
font-size: var(--font-xs);
line-height: 1.3;
}
.discover-group__measure-value {
color: var(--text);
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
font-weight: 600;
}
.discover-group__actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs) var(--space-sm);
align-items: center;
}
.discover-group__action {
display: inline-block;
padding: var(--space-xs) var(--space-sm);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: none;
color: var(--text-secondary);
font-size: var(--font-xs);
line-height: 1.2;
text-decoration: none;
cursor: pointer;
}
.discover-group__action--on {
border-color: var(--accent);
color: var(--accent);
}
.discover-group__action:hover {
border-color: var(--border-focus);
color: var(--text);
}
.discover-group__action:focus-visible {
outline: var(--radius-sm) solid var(--accent);
outline-offset: var(--radius-sm);
}
/* The two disclosures sit in their own row, right-aligned as a pair of
pills. An opened one takes the full row so its content is not squeezed
into a pill's width. */
.discover-group__more {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: var(--space-xs) var(--space-sm);
padding-top: var(--space-sm);
border-top: 1px solid var(--border);
}
.discover-group__disclosure {
flex: 0 0 auto;
max-width: 100%;
}
.discover-group__disclosure[open] {
flex: 1 0 100%;
order: -1;
}
.discover-group__disclosure > summary {
padding: var(--space-xs) var(--space-sm);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: var(--font-xs);
line-height: 1.2;
cursor: pointer;
list-style-position: outside;
white-space: nowrap;
}
.discover-group__disclosure > summary:hover {
color: var(--text);
}
.discover-group__disclosure > summary:focus-visible {
outline: var(--radius-sm) solid var(--accent);
outline-offset: var(--radius-sm);
color: var(--text);
}
/* The excerpts: each company's own words, which are the only thing that
makes the commonality concrete. */
.discover-group__excerpts {
display: grid;
gap: var(--space-sm);
margin: 0;
padding: var(--space-sm) 0 0;
list-style: none;
}
.discover-group__excerpt {
display: grid;
gap: var(--space-2xs);
min-width: 0;
}
.discover-group__excerpt-head {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: var(--space-xs);
}
.discover-group__excerpt-terms {
color: var(--text-muted);
font-size: var(--font-xxs);
line-height: 1.2;
}
.discover-group__excerpt-text {
margin: 0;
color: var(--text-secondary);
font-size: var(--font-xs);
line-height: 1.4;
overflow-wrap: anywhere;
}
.discover-group__detail {
padding-bottom: var(--space-xs);
}
.discover-group__profile {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
gap: var(--space-xs) var(--space-md);
margin: 0;
}
.discover-group__profile-item {
display: grid;
gap: 0;
min-width: 0;
}
.discover-group__profile-label {
color: var(--text-muted);
font-size: var(--font-xxs);
letter-spacing: 0.06em;
text-transform: uppercase;
}
.discover-group__profile-value {
margin: 0;
color: var(--text);
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
font-size: var(--font-xs);
overflow-wrap: anywhere;
}
.discover-group__buckets {
margin: var(--space-xs) 0 0;
color: var(--text-muted);
font-size: var(--font-xs);
line-height: 1.35;
}
.discover-group__buckets-label {
color: var(--text-secondary);
font-weight: 600;
}
@media (width <= 768px) {
.discover-group-summary {
align-items: flex-start;
flex-direction: column;
}
.discover-group__profile {
grid-template-columns: repeat(auto-fill, minmax(8em, 1fr));
}
}
@media (width <= 480px) {
/* One card reads as a single stack on a phone: the disclosures become
full-width targets rather than a thin line of text, and the sort
control takes the row it is in. */
.discover-group {
padding: var(--space-sm);
}
.discover-groups__summary {
padding: var(--space-sm);
}
.discover-groups__body {
padding: 0 var(--space-sm) var(--space-sm);
}
.discover-group__more {
justify-content: stretch;
}
.discover-group__disclosure {
flex: 1 1 100%;
}
.discover-group__disclosure > summary {
display: flex;
align-items: center;
min-height: var(--space-xl);
}
/* A group card is dense on purpose, but its member links and action pills
are read with a finger here: both take the 28px touch floor the
responsive audit enforces instead of the 14px line box the inline chip
gives them. inline-flex is what makes the floor a hit area rather than
a taller line. */
.discover-group__member-symbol {
display: inline-flex;
align-items: center;
min-height: var(--tab-height);
}
.discover-group__action {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: var(--tab-height);
}
}
.discover-cluster-filter {
display: inline-flex;
gap: var(--space-xs);
align-items: center;
padding: var(--space-xs) var(--space-sm);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: var(--font-xs);
white-space: nowrap;
}
.discover-cluster-filter strong {
color: var(--text);
font-weight: 600;
}
/* The way out of the narrowing, so it is sized as a target rather than as a
glyph: the `Γ` is small, and a 16x12 hit area is easy to miss next to the
label it has to read as belonging to. */
.discover-cluster-filter__clear {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: var(--icon-size);
min-height: var(--icon-size);
margin-right: calc(var(--space-xs) * -1);
padding: 0;
border: none;
border-radius: var(--radius-sm);
background: none;
color: var(--text-muted);
font-size: var(--font-sm);
line-height: 1;
cursor: pointer;
}
.discover-cluster-filter__clear:hover {
color: var(--text);
}
.discover-cluster-filter__clear:focus-visible {
outline: var(--radius-sm) solid var(--accent);
outline-offset: var(--radius-sm);
}
/* ββββββββββββββββββββββββββββββββββββββββββββ
Responsive β Discover
ββββββββββββββββββββββββββββββββββββββββββββ */
@media (width <= 768px) {
/* The toolbar scales as one piece on touch: common.css gives the
panel toggles a ~36px target here and 44px below, so the whole row
follows suit instead of leaving the inlined toggles at 28px. */
.control-panel--compact .control-panel__main {
--control-h: var(--toolbar-height);
}
.column-picker {
padding: var(--space-xs-plus) var(--space-sm);
gap: var(--space-xs);
}
.column-picker label {
padding: var(--space-xs-plus) var(--space-sm);
font-size: var(--font-xs);
min-height: var(--toolbar-height);
}
.filter-row {
flex-wrap: wrap;
gap: var(--space-xs);
}
.filter-row select.filter-col,
.filter-row select.filter-op,
.filter-row input.filter-val,
.filter-row input.filter-val-min,
.filter-row input.filter-val-max {
flex: 1 1 auto;
width: auto;
min-width: 60px;
}
.filter-row select,
.filter-row input {
height: 34px;
}
.preset-item {
padding: var(--space-sm);
min-height: var(--toolbar-height);
}
.preset-item__actions button {
padding: var(--space-xs) var(--space-sm);
min-height: var(--space-xl);
}
.presets-panel {
padding: var(--space-xs-plus) var(--space-sm);
}
}
@media (width <= 480px) {
/* A 50px row that wraps into two or three of them is 150px of toolbar
before the first result, so the strip scrolls sideways instead β the
same treatment .tf-selector and .control-panel__display already get.
44px is the target itself: on a phone there is no pointer gap to
leave room for. */
/* The toolbar wraps onto as many rows as it needs. A hidden scroll strip put
the view switch, Refresh and the AI button out of reach on a phone. */
.control-panel--compact .control-panel__main {
--control-h: var(--touch-min);
flex-wrap: wrap;
overflow: visible;
}
/* Pushing the Columns toggle to the far edge makes no sense once the
row is a scroll strip; let it follow the controls it belongs to. */
.control-panel--compact #toggle-discover-columns {
margin-left: 0;
}
.column-picker {
gap: var(--space-xs-plus);
}
.column-picker label {
flex: 1 1 calc(50% - var(--space-xs-plus));
justify-content: center;
min-height: var(--touch-min);
padding: var(--space-sm) var(--space-xs-plus);
}
.filter-row select,
.filter-row input {
height: var(--touch-min);
font-size: var(--font-sm);
}
.filter-remove {
min-width: var(--touch-min);
min-height: var(--touch-min);
}
.preset-item {
min-height: var(--touch-min);
}
.preset-item__actions button {
min-width: var(--trades-layout-offset);
min-height: var(--trades-layout-offset);
}
.preset-save-btn {
padding: 10px var(--space-sm-plus);
min-height: var(--touch-min);
}
/* 40px is the fallback lead column for a JS-supplied --row-cols track, not a
control floor: --touch-compact has the same value but names a control. */
.list-layout .stock-row--list,
.list-layout .stock-row--list-header {
grid-template-columns: var(--row-cols, 40px);
grid-auto-flow: column;
grid-auto-columns: max-content;
width: max-content;
min-width: 100%;
}
#table-container {
overflow-x: auto;
}
.discover-digest-cell {
max-width: 240px;
white-space: normal;
}
}
/* ββ Table density (list-layout rows) ββ
The shared .list-layout rows in common.css own the dense treatment (2px
padding, hairline separator); these stay as the discover-specific layer for
the multi-line AI Digest cell. Row-gap is 0 because the digest wraps inside
its own track β a row gap only separated the accidental sub-rows the base
card rule used to force. Rows top-align (instead of the base .stock-row's
vertical-center) so short cells line up with the digest's first line rather
than floating in the middle of a tall row. */
.list-layout .stock-row--list {
padding: var(--space-2xs) var(--space-sm);
gap: 0 var(--space-sm);
align-items: start;
}
/* ββ Group highlight ββ
A group's members are marked in place; nothing is removed from the list. The
rest is dimmed rather than hidden so the members are read among their
neighbours, which is the point of marking them: what a group sits next to is
part of what the group means. */
.list-layout.is-group-highlighted .stock-row--list {
opacity: 0.32;
transition: opacity var(--transition-fast) ease-out;
}
.list-layout.is-group-highlighted .stock-row--list.is-group-member {
opacity: 1;
box-shadow: inset 3px 0 0 var(--accent);
}
/* ββ Group tint rail ββ
Which group a row belongs to, readable without clicking anything: a 3px rail
in that group's own colour, down the left edge the row already has padding
against. Deliberately faint (55%) and confined to the edge -- a filled track
inside the row would read as a grade or a bar, and this is neither. Rows in no
group carry no tint class and so no rail, which is the honest state for them:
the list is the universe, not the groups. */
.list-layout .stock-row--list[class*="discover-group-tint-"] {
box-shadow: inset 3px 0 0 color-mix(in srgb, rgb(var(--group-tint-rgb)) 55%, transparent);
}
/* The highlighted group's members keep their own tint at full strength, so the
rail reads as the group's colour rather than as a generic "selected" state,
and the highlight stays legible against the tints of its neighbours. */
.list-layout.is-group-highlighted
.stock-row--list.is-group-member[class*="discover-group-tint-"] {
box-shadow: inset 3px 0 0 color-mix(in srgb, rgb(var(--group-tint-rgb)) 100%, transparent);
}
@media (prefers-reduced-motion: reduce) {
.list-layout.is-group-highlighted .stock-row--list {
transition: none;
}
}
/* Header row must match the data rows' horizontal padding and column gap AND
inherit the same --row-cols grid tracks so the CSS grid columns line up
vertically. Without grid-template-columns the header fell back to a single
implicit track while data rows used the JS-supplied --row-cols, and every
label ended up a track-width offset from the column it titles. */
.list-layout .stock-row--list-header {
padding: 0 var(--space-sm);
gap: 0 var(--space-sm);
/* Same 40px fallback as the list rows above: a column lead, not a control. */
grid-template-columns: var(--row-cols, 40px);
}
.list-layout .stock-row--list > span {
/* Vertically center single-line cells against a multi-line neighbor. */
align-self: center;
}
.list-layout .stock-row--list > .discover-digest-cell {
align-self: start;
}
/* Column alignment driven by header + data-cell col-align-* classes
(emitted from COLUMN_META.align in list-view.ts / getCellClass).
Numeric cells also carry .metric-value for sign color; icon/flag
columns are centered. */
.list-layout .col-align-right { text-align: right; }
.list-layout .col-align-center {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.list-layout .col-align-left { text-align: left; }
.list-layout .stock-row--list > .metric-value {
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
text-align: right;
}
/* Star button lives in the 40px lead grid track β pin it to its center. */
.list-layout .stock-row--list .unified-chart-action-btn {
place-self: center center;
}
.discover-digest {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
white-space: normal;
line-height: 1.5;
color: var(--text);
font-size: var(--font-sm);
overflow: hidden;
}
.discover-digest--empty {
color: var(--text-muted);
font-style: italic;
}
/* Symbol flags live in their own column next to Symbol. The shared
.symbol-flag carries a left margin for the old inline-next-to-symbol
layout, so drop it on the first badge and use a gap for the rest. */
.discover-flags-cell {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: var(--space-xs);
overflow: hidden;
}
.discover-flags-cell .symbol-flag {
margin-left: 0;
}
/* Inside the Advanced popover the prompt takes the whole group width; the
fixed toolbar width above does not apply there. */
.ui-disclosure--popover .discover-ai-prompt {
width: 100%;
height: var(--control-h);
}
/* ββ Phone: a stock is a card, not a table row ββ
The desktop table is a max-content grid that scrolls sideways, and at 390px
the last columns were cut off. On a phone each row is one card instead: the
star is a 44px button on the left, and symbol, price, change and volume
stack on their own lines beside it. The other selected columns stay on the
desktop table. The card reuses the table's markup and only re-places the
cells, so the sort header and the row click keep working. */
@media (width <= 480px) {
#table-container .stock-row--list-header {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs) var(--space-md);
padding: var(--space-xs) var(--space-sm);
min-height: var(--touch-min);
align-items: center;
}
#table-container .stock-row--list-header > span:not([data-col]) {
display: none;
}
#table-container .stock-row--list-header > [data-col]:not([data-col="name"], [data-col="close"], [data-col="change"], [data-col="volume"]) {
display: none;
}
#table-container .stock-row--list {
display: grid;
grid-template-columns: var(--touch-min) minmax(0, 1fr) auto;
grid-auto-flow: row;
grid-auto-columns: auto;
grid-template-rows: repeat(4, auto);
align-items: center;
width: auto;
min-width: 0;
gap: 0 var(--space-sm);
padding: var(--space-xs) var(--space-xs);
}
/* The star (or the spacer that stands in for it) spans the card's height. */
#table-container .stock-row--list > :first-child {
grid-column: 1;
grid-row: 1 / span 4;
width: var(--touch-min);
height: var(--touch-min);
min-width: var(--touch-min);
min-height: var(--touch-min);
padding: 0;
justify-self: center;
}
#table-container .stock-row--list > [data-col] {
display: none;
min-width: 0;
}
#table-container .stock-row--list > [data-col="name"],
#table-container .stock-row--list > [data-col="close"],
#table-container .stock-row--list > [data-col="change"],
#table-container .stock-row--list > [data-col="volume"] {
display: block;
grid-column: 2;
justify-self: start;
white-space: nowrap;
}
#table-container .stock-row--list > [data-col="name"] {
grid-row: 1;
font-weight: 600;
}
#table-container .stock-row--list > [data-col="close"] {
grid-row: 2;
}
#table-container .stock-row--list > [data-col="change"] {
grid-row: 3;
}
#table-container .stock-row--list > [data-col="volume"] {
grid-row: 4;
}
/* The symbol link is the card's title; its own line box keeps it tall
enough for a finger. */
#table-container .stock-row--list .symbol-link {
display: inline-flex;
align-items: center;
min-height: var(--touch-min);
}
}
/* ββ Symbol button ββ
The symbol in the list opens its chart in the panel. A native button, so the
Enter and Space keys press it; it is styled to read as the symbol it was. */
.discover-symbol-btn {
appearance: none;
margin: 0;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
text-align: left;
cursor: pointer;
}
.discover-symbol-btn:focus-visible {
outline: var(--focus-ring-width) solid var(--border-focus);
outline-offset: var(--focus-ring-offset);
}
/* A touch press needs a finger-sized target; the rows stay dense with a mouse. */
@media (width <= 1024px) {
.discover-symbol-btn {
display: inline-flex;
align-items: center;
min-width: var(--touch-min);
min-height: var(--touch-min);
}
}
.list-layout .stock-row--list.is-chart-selected {
background: var(--accent-bg);
box-shadow: inset 3px 0 0 var(--border-focus);
}
/* ββ Chart panel ββ
Opened from a symbol in the list. Desktop: a sticky column beside the list,
which gives up only its share of the width. Tablet: below the list, and the
list scrolls on its own so the selected row stays in reach. Phone: a
full-screen sheet. The chart is the existing chart card, unchanged. */
.discover-workspace {
min-width: 0;
}
.discover-chart-panel {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
overflow: hidden;
background: var(--surface-1);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
}
.discover-chart-panel__header {
display: flex;
align-items: center;
gap: var(--space-xs);
padding: var(--space-xs) var(--space-sm);
border-bottom: 1px solid var(--border);
}
.discover-chart-panel__title {
flex: 1 1 auto;
min-width: 0;
margin: 0;
overflow: hidden;
color: var(--text-primary);
font-size: inherit;
font-weight: 700;
text-overflow: ellipsis;
white-space: nowrap;
}
.discover-chart-panel__btn {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
min-width: var(--touch-min);
min-height: var(--touch-min);
margin: 0;
padding: 0;
border: 0;
border-radius: var(--radius-md);
background: none;
color: var(--text-secondary);
font: inherit;
font-size: 1.25rem;
line-height: 1;
text-decoration: none;
cursor: pointer;
}
.discover-chart-panel__btn:hover {
background: var(--accent-bg);
color: var(--text-primary);
}
.discover-chart-panel__btn:focus-visible {
outline: var(--focus-ring-width) solid var(--border-focus);
outline-offset: var(--focus-ring-offset);
}
.discover-chart-panel__body {
flex: 1 1 auto;
min-height: 0;
min-width: 0;
overflow: auto;
padding: var(--space-xs);
}
.discover-chart-panel__body > * {
display: block;
width: 100%;
}
@media (width > 1024px) {
.discover-workspace.has-chart-panel {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(20rem, 40%);
gap: var(--space-md);
align-items: start;
}
.discover-workspace.has-chart-panel .discover-chart-panel {
position: sticky;
top: var(--space-md);
max-height: calc(100vh - var(--space-xl));
}
}
@media (600px < width <= 1024px) {
.discover-workspace.has-chart-panel #table-container {
max-height: 50vh;
overflow: auto;
}
.discover-workspace.has-chart-panel .discover-chart-panel {
margin-top: var(--space-md);
}
}
@media (width <= 600px) {
.discover-chart-panel {
position: fixed;
inset: 0;
/* Above the app nav (z-500), so the sheet covers the whole screen. */
z-index: var(--z-500);
border: 0;
border-radius: 0;
background: var(--bg);
}
}
/* ββ StockTitan quick links ββ
Links to StockTitan pages for the selected symbol, in the chart panel header
beside the chart link and close button. */
.discover-chart-panel__quick-links {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs);
align-items: center;
flex: 0 0 auto;
}
.discover-chart-panel__link {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: var(--touch-min);
min-height: var(--touch-min);
padding: 0 var(--space-sm);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--surface);
color: var(--text-secondary);
font-size: var(--font-xs);
line-height: 1;
text-decoration: none;
cursor: pointer;
}
.discover-chart-panel__link:hover {
background: var(--accent-bg);
color: var(--text-primary);
border-color: var(--border-focus);
}
.discover-chart-panel__link:focus-visible {
outline: var(--focus-ring-width) solid var(--border-focus);
outline-offset: var(--focus-ring-offset);
}
/* ββββββββββββββββββββββββββββββββββββββββββββ
Discover Page β Specific Styles
ββββββββββββββββββββββββββββββββββββββββββββ */
/* ββ Group tints ββ
The colour that ties a row in the list to the group card that claims it. A run
returns at most twelve groups and this hands out eight, so a long run has two
groups sharing a hue; the cards are ordered biggest group first, so that is
also why the repeat lands on the two smallest. Written as RGB triplets rather
than colours because every consumer wants the same tint at its own alpha β a
55% rail on a row and a 70% border on a card are the same hue, and spelling
that hue twice as a hex would let the two drift apart.
`:root` rather than a page-scoped selector, as in research.css and
dilution.css: the tints are inert until a rule below maps one onto
`--group-tint-rgb`, and only this file's classes are ever given one. */
:root {
--discover-group-tint-1: 96, 165, 250;
--discover-group-tint-2: 45, 212, 191;
--discover-group-tint-3: 167, 139, 250;
--discover-group-tint-4: 250, 204, 21;
--discover-group-tint-5: 244, 114, 182;
--discover-group-tint-6: 132, 204, 22;
--discover-group-tint-7: 249, 115, 22;
--discover-group-tint-8: 56, 189, 248;
}
.discover-group-tint-1 { --group-tint-rgb: var(--discover-group-tint-1); }
.discover-group-tint-2 { --group-tint-rgb: var(--discover-group-tint-2); }
.discover-group-tint-3 { --group-tint-rgb: var(--discover-group-tint-3); }
.discover-group-tint-4 { --group-tint-rgb: var(--discover-group-tint-4); }
.discover-group-tint-5 { --group-tint-rgb: var(--discover-group-tint-5); }
.discover-group-tint-6 { --group-tint-rgb: var(--discover-group-tint-6); }
.discover-group-tint-7 { --group-tint-rgb: var(--discover-group-tint-7); }
.discover-group-tint-8 { --group-tint-rgb: var(--discover-group-tint-8); }
/* ββ Control panel toolbar ββ
Everything the toolbar holds is normalised to --control-height so the
row reads as one aligned strip. Without this the row was as tall as
its tallest member (the session <select>, 35px) while its other
controls floated at 16.5 / 24 / 28 / 29 / 33px inside it. Only
dimensions are overridden here β the shared component rules in
common.css stay the single owner of everything else. */
.control-panel--compact .control-panel__main {
--control-h: var(--control-height);
gap: var(--space-xs);
}
.control-panel--compact .control-panel__main > * {
flex: 0 0 auto;
}
/* Generous width on the session select pays for itself: it is the only
control whose caption changes length ("1W Gainers" / "Afterhours"). */
.control-panel--compact #discover-session {
height: var(--control-h);
padding: 0 var(--space-sm);
min-width: 11em;
}
/* The compact panel only follows the control-height token, which steps up
on touch widths; button padding and font come from the shared .btn. */
.control-panel--compact .btn {
height: var(--control-h);
}
/* The AI prompt is an editable field, so it needs a readable width without
taking the row over; it shares the toolbar's control height. */
.control-panel--compact .discover-ai-prompt {
height: var(--control-h);
width: clamp(13em, 22vw, 24em);
min-width: 0;
}
/* Segment controls are their own bordered strips; equalise the strip
height and the buttons inside it so both edges line up with the
buttons beside them. */
.control-panel--compact .view-toggle,
.control-panel--compact .tf-selector {
height: var(--control-h);
padding: var(--space-2xs);
gap: var(--space-2xs);
}
.control-panel--compact .view-toggle .view-btn,
.control-panel--compact .tf-selector .tf-btn {
height: calc(var(--control-h) - var(--table-cell-pad-y));
padding: 0 var(--space-sm);
display: inline-flex;
align-items: center;
}
.control-panel--compact .control-panel__toggle {
height: var(--control-h);
padding: 0 var(--space-sm);
align-self: center;
}
/* The count badge is plain text, so it has no box to align β give it the