Spaces:
Running
Running
Download static/css/chart.css from Arrechenash/stocks: direct link, hf CLI and curl.
- Browser
- Download file 35.9 kB
-
https://huggingface.co/spaces/Arrechenash/stocks/resolve/main/static/css/chart.css
- Command line
-
hf download hf://spaces/Arrechenash/stocks/static/css/chart.css
-
curl -L -o chart.css https://huggingface.co/spaces/Arrechenash/stocks/resolve/main/static/css/chart.css
35.9 kB
/* =======================================
Chart Page - Unified with common.css
ONLY unique layout overrides. ALL variables from common.css.
Structural scaffold only β visual polish of sub-elements (dropdown
items, crosshair fine details, drawing-tool active states) is left
for the follow-up interactive-JS task.
======================================= */
body.chart-page {
display: flex;
flex-direction: column;
height: var(--viewport-h);
overflow: hidden;
}
.chart-shell {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ββ Top bar ββ */
.chart-topbar {
display: flex;
align-items: center;
gap: var(--space-md);
flex-wrap: wrap;
min-height: var(--toolbar-height);
padding: var(--space-xs) var(--space-sm);
background: var(--bg-elevated);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
/* On a small phone the topbar wraps into three or four rows and eats the
chart's height, so it gets tighter here to pay the chart back for
dropping its width floor (see the <=480px block). */
@media (width <= 480px) {
/* The watchlist's Full view button (25px tall) is below the audit's 28px
touch floor; the TradingView attribution link is in common.css. */
.chart-watchlist-header-btn {
display: inline-flex;
align-items: center;
min-height: var(--touch-floor);
}
.chart-topbar {
gap: var(--space-sm);
padding: var(--space-xs) var(--space-sm);
}
/* The action icons (refresh, alerts, indicators, date jumpβ¦) are wider than
a 360px phone. They wrap onto a second row instead of running off the
right edge, where the date jump was cut in half and could not be reached. */
.chart-topbar__actions {
flex-wrap: wrap;
margin-left: 0;
width: 100%;
}
}
.chart-topbar__symbol {
position: relative;
flex-shrink: 0;
}
.chart-symbol-input {
width: 140px;
background: transparent;
border-color: transparent;
font-size: var(--font-lg);
font-weight: 600;
}
.chart-symbol-input:focus,
.chart-symbol-input:hover {
background: var(--bg-elevated);
border-color: var(--border);
}
.chart-symbol-dropdown {
/* Surface from .surface (common.css); the rule owns the placement. */
position: absolute;
top: calc(100% + var(--space-2xs));
left: 0;
min-width: 260px;
max-height: 320px;
overflow-y: auto;
box-shadow: var(--shadow-md);
z-index: var(--z-100);
}
.chart-symbol-dropdown.hidden {
display: none;
}
.chart-timeframe-bar {
position: relative;
flex-shrink: 0;
}
.chart-tf-current {
display: flex;
align-items: center;
gap: var(--space-xs);
}
.chart-tf-caret {
font-size: var(--font-xs);
line-height: 1;
}
.chart-tf-dropdown {
/* Surface from .surface (common.css). */
position: absolute;
top: calc(100% + var(--space-2xs));
left: 0;
min-width: 140px;
box-shadow: var(--shadow-md);
z-index: var(--z-100);
padding: var(--space-xs);
display: flex;
flex-direction: column;
gap: var(--space-2xs);
}
.chart-tf-dropdown.hidden {
display: none;
}
.chart-tf-group-label {
font-size: var(--font-xs);
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
padding: var(--space-xs) var(--space-sm) var(--space-2xs);
}
.chart-tf-dropdown .chart-tf-btn {
display: block;
width: 100%;
text-align: left;
background: transparent;
border-color: transparent;
}
.chart-tf-dropdown .chart-tf-btn:hover {
background: var(--border);
}
.chart-tf-btn.active {
background: var(--accent);
color: var(--bg);
border-color: var(--accent);
}
.chart-topbar__price {
display: flex;
align-items: center;
gap: var(--space-sm);
font-family: var(--font-mono);
}
.chart-price-display {
font-size: var(--font-lg);
font-weight: 600;
color: var(--text-primary);
}
.chart-price-change {
font-size: var(--font-sm);
color: var(--text-secondary);
}
.chart-price-change.positive {
color: var(--positive);
}
.chart-price-change.negative {
color: var(--negative);
}
.chart-market-status-dot {
width: var(--space-sm);
height: var(--space-sm);
border-radius: var(--radius-round);
background: var(--text-dim);
flex-shrink: 0;
}
.chart-market-status-dot.open {
background: var(--positive);
}
.chart-market-status-dot.closed {
background: var(--negative);
}
.chart-market-status-dot.pre {
background: var(--warning);
}
.chart-market-status-dot.post {
background: var(--info);
}
.chart-topbar__actions {
display: flex;
gap: var(--space-sm);
margin-left: auto;
}
.chart-date-jump {
position: relative;
}
.chart-date-jump-popover {
/* Surface from .surface (common.css). */
position: absolute;
top: calc(100% + var(--space-2xs));
right: 0;
width: 240px;
box-shadow: var(--shadow-md);
z-index: var(--z-100);
padding: var(--space-sm);
}
.chart-date-jump-popover.hidden {
display: none;
}
.chart-date-jump-inputrow {
margin-bottom: var(--space-sm);
}
.chart-date-jump-inputrow .input-field {
width: 100%;
font-family: var(--font-mono);
}
.chart-date-jump-timerow {
display: flex;
align-items: center;
gap: var(--space-xs);
}
.chart-date-jump-time-input {
width: 100%;
text-align: center;
/* Undo .input-field's 100% width from the rule above so the two number
fields share the row evenly instead of each claiming the full row. */
flex: 1;
}
.chart-date-jump-time-sep {
color: var(--text-muted);
font-weight: 600;
}
.chart-date-jump-cal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-xs);
font-size: var(--font-sm);
font-weight: 600;
color: var(--text-primary);
}
.chart-date-jump-cal-header button {
background: transparent;
border: none;
color: var(--text-secondary);
cursor: pointer;
font-size: var(--font-md);
line-height: 1;
padding: var(--space-2xs) var(--space-sm);
border-radius: var(--radius-sm);
}
.chart-date-jump-cal-header button:hover {
background: var(--border);
color: var(--text-primary);
}
.chart-date-jump-cal-dow,
.chart-date-jump-cal-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
}
.chart-date-jump-cal-dow span {
text-align: center;
font-size: var(--font-xs);
color: var(--text-muted);
padding: var(--space-2xs) 0 var(--space-xs);
}
.chart-date-jump-cell {
background: transparent;
border: none;
color: var(--text-primary);
font-size: var(--font-sm);
font-family: var(--font-mono);
padding: var(--space-xs-plus) 0;
cursor: pointer;
border-radius: var(--radius-sm);
}
.chart-date-jump-cell:hover {
background: var(--border);
}
.chart-date-jump-cell--other {
color: var(--text-dim);
}
.chart-date-jump-cell--today {
box-shadow: inset 0 0 0 1px var(--accent);
}
.chart-date-jump-cell--selected {
background: var(--accent);
color: var(--bg);
}
.chart-date-jump-go {
width: 100%;
margin-top: var(--space-sm);
}
.chart-topbar__actions .btn svg {
width: 18px;
height: 18px;
/* SVG has no intrinsic width/height attributes, so flexbox's automatic
minimum size for it resolves to 0 and the default flex-shrink:1
collapses it β pin it so the icon can't shrink away. */
flex-shrink: 0;
}
/* ββ Main chart row ββ */
.chart-body {
flex: 1;
min-height: 0;
display: flex;
overflow: auto hidden;
}
/* Drawing toolbar β slim vertical strip on the left of the chart */
.chart-drawing-toolbar {
width: var(--touch-min);
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-xs);
padding: var(--space-sm) 0;
background: var(--bg-elevated);
border-right: 1px solid var(--border);
overflow-y: auto;
}
/* Collapses the strip to the hamburger: on a phone the 44px of tools is
12% of the width and the tools are only needed while drawing. */
.chart-drawing-toolbar.is-collapsed {
padding: 0;
}
.chart-drawing-toolbar.is-collapsed > *:not(.chart-toolbar-toggle) {
display: none;
}
.chart-toolbar-toggle {
width: var(--trades-layout-offset);
height: var(--trades-layout-offset);
padding: 0;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
border-radius: var(--radius-sm);
transition: all var(--transition-fast);
}
.chart-toolbar-toggle:hover {
color: var(--text);
background: var(--border);
}
.chart-toolbar-toggle svg {
width: 18px;
height: 18px;
display: block;
}
.chart-tool-btn {
width: var(--control-height);
height: var(--control-height);
padding: 0;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: 1px solid transparent;
border-radius: var(--radius-md);
color: var(--text-muted);
cursor: pointer;
font-size: var(--font-md);
transition: all var(--transition-fast);
}
.chart-tool-btn:hover {
color: var(--text);
background: var(--border);
}
.chart-tool-btn.active {
color: var(--bg);
background: var(--accent);
border-color: var(--accent);
}
.chart-tool-btn svg {
width: 18px;
height: 18px;
flex-shrink: 0;
}
.chart-chart-area {
flex: 1;
/* Keeps the candlesticks legible instead of being crushed to an unusable
sliver when multiple side panels are open on a narrow viewport β the
panels scroll horizontally (chart-body) rather than stealing this
space. Capped at 100% so a 375px phone (331px left after the drawing
toolbar) doesn't have to scroll the chart sideways. */
min-width: min(var(--chart-min-width), 100%);
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
}
.chart-chart-container {
flex: 1;
min-height: 0;
position: relative;
}
.chart-secondary-pane {
/* Split view gives the secondary pane the same 75/25 share the old
flex-grow math produced; once the seam is dragged, this basis is the
splitter's own size variable and the primary chart (flex: 1) absorbs
whatever is left. */
flex: 0 0 var(--chart-secondary-height, 75%);
min-height: var(--picker-list-height);
display: flex;
flex-direction: column;
border-top: 1px solid var(--border);
position: relative;
}
/* The seam rides on the pane's own top edge, so it follows the split
toggle and the min-height floor without a separate offset variable. */
.chart-secondary-pane > .panel-resize-handle--row {
top: 0;
}
.chart-secondary-pane.hidden {
display: none;
}
.chart-pane-header {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 30px;
padding: 0 var(--space-sm);
background: var(--bg-elevated);
border-bottom: 1px solid var(--border);
color: var(--text-muted);
font-size: var(--font-xs);
font-weight: 600;
}
.chart-pane-timeframes {
display: flex;
gap: var(--space-2xs);
}
.chart-pane-timeframes button {
padding: var(--space-2xs) var(--space-xs-plus);
border: 1px solid transparent;
border-radius: var(--radius-sm);
background: transparent;
color: var(--text-muted);
cursor: pointer;
}
.chart-pane-timeframes button:hover,
.chart-pane-timeframes button.active {
background: var(--accent);
border-color: var(--accent);
color: var(--bg);
}
.chart-secondary-pane .chart-chart-container {
flex: 1;
min-height: 0;
}
.chart-ohlc-legend {
position: absolute;
top: var(--space-sm);
left: var(--space-sm);
z-index: var(--z-5);
font-family: var(--font-mono);
font-size: var(--font-xs);
color: var(--text-secondary);
pointer-events: none;
}
.chart-legend-row {
display: block;
}
.chart-session-label {
position: absolute;
top: var(--space-sm);
right: var(--space-sm);
z-index: var(--z-5);
font-size: var(--font-xs);
color: var(--text-muted);
pointer-events: none;
}
/* Right-docked watchlist panel */
.chart-watchlist-panel {
width: 320px;
flex-shrink: 0;
position: relative;
display: flex;
flex-direction: column;
background: var(--bg-elevated);
border-left: 1px solid var(--border);
overflow: hidden;
}
/* Right-docked Level 2 / Time & Sales panel. The primary historical/live
chart remains the Chart page's canvas; this panel contributes market depth
and prints without rendering a second chart. */
.chart-level2-panel {
width: var(--chart-height-default);
flex-shrink: 0;
position: relative;
display: flex;
flex-direction: column;
background: var(--bg-elevated);
border-left: 1px solid var(--border);
overflow: hidden;
}
/* Draggable width handle β first child of every right-docked panel
(Watchlist, Level 2, Screener), pinned to the panel's left edge so
dragging it resizes the panel like TradingView's own side panels. The
box, the 1px rule, the hover reveal and the focus ring are the shared
.panel-resize-handle (common.css), like every other resize seam in the
app; this rule is position only. The hit area widens from this panel's
old private 6px to the shared 10px. No transition, and none inherited:
the drag edits the panel width every frame, so one would lag behind the
pointer. */
.chart-panel-resize-handle {
left: -3px;
}
.chart-level2-panel.hidden {
display: none;
}
.chart-level2-panel .level2-tape {
height: 100%;
min-height: 0;
flex: 1;
}
.chart-level2-panel .l2-grid {
grid-template:
"book" minmax(0, 1fr)
"tape" minmax(0, 1fr)
/ minmax(0, 1fr);
}
.chart-watchlist-panel.hidden {
display: none;
}
.chart-watchlist-add-row {
padding: var(--space-sm);
border-bottom: 1px solid var(--border);
}
.chart-watchlist-add-row .input-field {
width: 100%;
min-width: 0;
}
.chart-watchlist-add-error {
margin-top: var(--space-xs);
font-size: var(--font-xs);
color: var(--negative);
}
/* Header cluster: the "Full view" toggle sits left of the close button, so
the title keeps its own row and the actions group pushes right. */
.chart-watchlist-header-actions {
margin-left: auto;
display: flex;
align-items: center;
gap: var(--space-xs);
}
.chart-watchlist-header-btn {
background: transparent;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: var(--font-xs);
padding: var(--space-xs) var(--space-sm);
cursor: pointer;
white-space: nowrap;
}
.chart-watchlist-header-btn:hover {
color: var(--text-primary);
border-color: var(--text-muted);
}
.chart-watchlist-header-btn[aria-pressed="true"] {
color: var(--text-primary);
border-color: var(--text-muted);
background: var(--bg-elevated);
}
/* The full Watchlist page body, mounted over the compact list inside the
same panel. It keeps the view's own common.css styles; these rules only
give it the panel's scroll and sizing behaviour. The panel rule above
already establishes `position: relative`, which is what lets this inset
overlay cover it. */
.chart-watchlist-fullview {
position: absolute;
inset: 0;
overflow-y: auto;
background: var(--bg-primary);
padding: var(--space-sm);
z-index: 2;
}
.chart-watchlist-fullview.hidden {
display: none;
}
.chart-watchlist-add-error.hidden {
display: none;
}
.chart-watchlist-list {
flex: 1;
min-height: 0;
overflow-y: auto;
}
/* The panel renders through the shared ListView (the Watchlist page's list
view), so its rows wear the shared .stock-row-* cells. The page rows are
bordered cards; in a 240-560px docked panel they become flush rows, and the
change chip loses the rounded pill it has on a full-width page. */
.chart-watchlist-list .stock-row {
border: none;
border-bottom: 1px solid var(--border);
border-radius: var(--radius-none);
font-family: var(--font-mono);
font-size: var(--font-sm);
gap: var(--space-xs);
padding: var(--space-xs) var(--space-sm);
}
.chart-watchlist-list .stock-row:hover {
border-color: var(--border);
background: var(--border);
}
.chart-watchlist-list .stock-row-change {
padding: 0;
border-radius: var(--radius-none);
text-align: right;
background: none;
}
.chart-watchlist-list .stock-row-price {
text-align: right;
}
.chart-watchlist-list .list-header {
display: none;
}
/* Shared panel header (watchlist + screener) */
.chart-panel-header {
display: flex;
align-items: center;
gap: var(--space-sm);
padding: var(--space-sm) var(--space-md);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.chart-panel-title {
font-size: var(--font-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-secondary);
}
.chart-panel-close {
margin-left: auto;
background: transparent;
border: none;
color: var(--text-muted);
font-size: var(--font-xl);
line-height: 1;
cursor: pointer;
padding: 0 var(--space-xs);
}
.chart-panel-close:hover {
color: var(--text);
}
/* ββ Right-docked screener panel ββ */
.chart-screener-panel {
width: var(--panel-width-xl);
flex-shrink: 0;
position: relative;
display: flex;
flex-direction: column;
background: var(--bg-elevated);
border-left: 1px solid var(--border);
overflow: hidden;
}
.chart-screener-panel.hidden {
display: none;
}
.chart-screener-tabs {
display: flex;
gap: var(--space-xs);
}
.chart-screener-tab {
background: transparent;
border: 1px solid var(--border);
color: var(--text-muted);
padding: var(--space-2xs) var(--space-sm);
font-size: var(--font-xs);
border-radius: var(--radius-sm);
cursor: pointer;
}
.chart-screener-tab.active {
background: var(--accent);
color: var(--bg);
border-color: var(--accent);
}
.chart-screener-filters {
display: flex;
gap: var(--space-sm);
flex-wrap: wrap;
align-items: flex-end;
padding: var(--space-sm) var(--space-md);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.chart-screener-filters .input-field {
min-width: 100px;
width: 120px;
}
.chart-screener-results {
flex: 1;
min-height: 0;
overflow: auto;
}
.chart-screener-table {
width: 100%;
font-size: var(--font-sm);
}
.chart-screener-table th,
.chart-screener-table td {
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.chart-screener-table th.chart-sortable {
cursor: pointer;
}
.chart-screener-table th.chart-sortable:hover {
color: var(--text);
}
/* ββ Status bar ββ */
.chart-status-bar {
display: none !important;
}
.chart-status-timezone {
margin-left: auto;
flex-shrink: 0;
}
/* ββ Context menu (right-click on chart) ββ */
.chart-context-menu {
/* Surface from .surface (common.css). */
position: fixed;
z-index: var(--z-max);
min-width: 180px;
box-shadow: var(--shadow-lg);
padding: var(--space-xs) 0;
}
.chart-context-menu.hidden {
display: none;
}
/* ββ Floating command prompt (Cmd/Ctrl+K style) ββ */
.chart-command-prompt {
/* Surface from .surface (common.css); this rule owns the placement. */
position: fixed;
top: 15%;
left: 50%;
transform: translateX(-50%);
width: min(600px, 90vw);
z-index: var(--z-max);
box-shadow: var(--shadow-lg);
padding: var(--space-md);
}
.chart-command-prompt.hidden {
display: none;
}
.chart-command-input {
width: 100%;
}
.chart-command-results {
margin-top: var(--space-sm);
max-height: 300px;
overflow-y: auto;
}
.chart-command-empty {
padding: var(--space-sm);
color: var(--text-muted);
font-size: var(--font-sm);
}
.chart-dropdown-item--active {
background: var(--border);
}
/* ββ Symbol search dropdown items ββ */
.chart-dropdown-item {
display: flex;
align-items: center;
gap: var(--space-sm);
padding: var(--space-xs) var(--space-sm);
cursor: pointer;
}
.chart-dropdown-item:hover {
background: var(--border);
}
.chart-dropdown-symbol {
font-weight: 600;
color: var(--text-primary);
font-family: var(--font-mono);
}
.chart-dropdown-desc {
color: var(--text-muted);
font-size: var(--font-xs);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* ββ OHLC legend fine details ββ */
.chart-legend-symbol {
font-weight: 600;
color: var(--text-primary);
}
.chart-legend-tf {
color: var(--text-muted);
text-transform: uppercase;
}
.chart-legend-item {
margin-left: var(--space-sm);
}
.chart-ohlc-legend .positive {
color: var(--positive);
}
.chart-ohlc-legend .negative {
color: var(--negative);
}
/* ββ Context menu items ββ */
.chart-context-item {
padding: var(--space-sm) var(--space-md);
font-size: var(--font-sm);
color: var(--text-primary);
cursor: pointer;
white-space: nowrap;
}
.chart-context-item:hover {
background: var(--border);
}
.chart-context-item--disabled {
color: var(--text-dim);
cursor: default;
pointer-events: none;
}
.chart-context-shortcut {
float: right;
margin-left: var(--space-md);
color: var(--text-muted);
font-size: var(--font-xs);
}
/* ββ Watchlist rows ββ */
.chart-watchlist-analyze {
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--font-xs);
padding: 0 var(--space-xs);
}
.chart-watchlist-analyze:hover {
color: var(--text-primary);
}
.chart-watchlist-remove {
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
font-size: var(--font-md);
line-height: 1;
padding: 0 var(--space-xs);
flex-shrink: 0;
}
.chart-watchlist-remove:hover {
color: var(--negative);
}
/* ββ Screener results ββ */
.chart-screener-table td.positive {
color: var(--positive);
}
.chart-screener-table td.negative {
color: var(--negative);
}
.chart-sort-arrow {
color: var(--accent);
}
/* ββ Responsive ββ */
@media (width <= 768px) {
/* The floating hamburger (common.css) is 38px tall at 8px from the
top-left corner, so the shell has to reserve the button plus its
offset; the chart page has no .page-wrapper, so the reservation is
duplicated here instead of inherited. 36px reserved less than the
46px the button occupies, and the top of the topbar sat under it. */
body.chart-page .chart-shell {
padding-top: calc(var(--nav-float-size) + var(--space-md));
}
}
@media (width <= 1024px) {
/* Side panels stop being columns: 700px of screener or 420px of tape
next to a 360px chart fits nothing, so all three (.chart-panel--overlay)
become a bottom sheet pinned to the physical bottom edge. The close
button in each panel header still dismisses it. */
.chart-panel--overlay {
position: fixed;
inset: auto 0 0;
width: auto;
max-width: 100vw;
height: auto;
max-height: 80dvh;
z-index: var(--z-200);
border-left: none;
border-top: 1px solid var(--border);
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
box-shadow: 0 -4px var(--space-lg) color-mix(in srgb, var(--black) 40%, transparent);
}
/* Scrim behind whichever panel is open. It is purely decorative β the
panel's own close button is the way out, there is no click handler
on it. */
.chart-shell:has(.chart-panel--overlay:not(.hidden))::before {
content: "";
position: fixed;
inset: 0;
background: color-mix(in srgb, var(--black) 50%, transparent);
z-index: var(--z-199);
pointer-events: none;
}
.chart-panel--overlay .chart-panel-resize-handle {
display: none;
}
.chart-screener-filters .input-field {
width: 100px;
}
}
@media (width <= 480px) {
/* The panels are sheets now (see <=1024px), so the chart row is the full
width and the 360px floor buys nothing: drop it and let the candles
fill whatever the phone gives, trading a little extra width for the
height the tighter topbar hands back. */
.chart-chart-area {
min-width: 0;
}
}
/* Touch targets: the responsive policy lives in common.css, and its tier is
the 768px tablet one -- a hand is a hand at 700px too. This page's dense
controls are 18-32px wide on desktop; 44px min keeps the same visual weight
(the icon stays put) while the hit area grows. */
@media (width <= 768px) {
.chart-tool-btn,
.chart-levels-btn,
.chart-panel-close,
.chart-screener-tab,
.chart-date-jump-cell,
.chart-alert-btn {
min-width: var(--touch-min);
min-height: var(--touch-min);
}
}
@media (width <= 768px) {
.chart-replay-toolbar {
gap: var(--space-2xs);
padding: var(--space-2xs);
}
.chart-replay-speed-btn {
padding: 0 var(--space-xs);
}
}
/* ββ Custom tooltips (Play/Forward/Jump-to-realtime/Close/Replay) ββ
TradingView shows a dark, custom-styled tooltip below these icon buttons
(plus keycap-style shortcut chips we don't reproduce β see report). The
native browser `title` attribute renders as a plain OS tooltip with a
multi-second delay, nothing like that β this reproduces the shape/timing
instead, scoped to the Chart shell only. */
.chart-shell [data-tooltip] {
position: relative;
}
.chart-shell [data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
top: calc(100% + var(--space-xs-plus));
left: 50%;
transform: translateX(-50%);
background: var(--surface-raised);
color: var(--text-primary);
padding: var(--space-xs) var(--space-sm);
border-radius: var(--radius-sm);
font-size: var(--font-xs);
white-space: nowrap;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity var(--transition-fast);
z-index: var(--z-100);
box-shadow: var(--shadow-sm);
}
.chart-shell [data-tooltip]:hover::after {
opacity: 1;
visibility: visible;
transition-delay: 0.4s;
}
/* ββ Bar Replay ββ */
#chart-replay-toggle.active {
background: var(--accent);
color: var(--bg);
border-color: var(--accent);
}
/* ββ Prev-day Price Levels toggle ββ */
/* Lives in the left drawing toolbar but is NOT a drawing tool β owns a
separate class so the toolbar bindings (`.chart-tool-btn` + data-tool)
skip it. Styled to match .chart-tool-btn exactly. */
.chart-levels-btn {
width: var(--space-xl);
height: var(--space-xl);
padding: 0;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: 1px solid transparent;
border-radius: var(--radius-md);
color: var(--text-muted);
cursor: pointer;
font-size: var(--font-md);
transition: all var(--transition-fast);
}
.chart-levels-btn:hover {
color: var(--text);
background: var(--border);
}
.chart-levels-btn.active {
color: var(--bg);
background: var(--accent);
border-color: var(--accent);
}
.chart-levels-btn svg {
width: 18px;
height: 18px;
flex-shrink: 0;
}
.chart-replay-badge {
font-size: var(--font-xs);
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
color: var(--negative);
background: color-mix(in srgb, var(--negative) 12%, transparent);
border: 1px solid color-mix(in srgb, var(--negative) 40%, transparent);
border-radius: var(--radius-sm);
padding: var(--space-2xs) var(--space-sm);
}
.chart-replay-anchor-line {
position: absolute;
top: 0;
bottom: 0;
border-left: 1px dashed var(--text-muted);
z-index: var(--z-10);
pointer-events: none;
}
.chart-replay-toolbar {
position: absolute;
bottom: var(--space-md);
left: 50%;
transform: translateX(-50%);
z-index: var(--z-max);
display: flex;
align-items: center;
gap: var(--space-xs);
background: var(--surface-raised);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
padding: var(--space-xs);
}
.chart-replay-toolbar.hidden {
display: none;
}
.chart-replay-toolbar .chart-tool-btn:disabled {
opacity: 0.4;
cursor: default;
pointer-events: none;
}
.chart-replay-speed-btn {
width: auto;
padding: 0 var(--space-sm);
font-size: var(--font-xs);
font-family: var(--font-mono);
}
/* ββ Replay Trading panel (floating, draggable overlay) ββ */
.chart-replay-trading-panel {
position: fixed;
z-index: var(--z-200); /* scrim del panel overlay de chart (capa 200, P3.11) */
width: 320px;
max-width: calc(100vw - var(--space-md));
max-height: calc(var(--viewport-h) - 96px);
top: 72px;
right: var(--space-md);
display: flex;
flex-direction: column;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
overflow: hidden;
}
.chart-replay-trading-panel.hidden {
display: none;
}
/* The whole header is the drag handle (close button stays clickable). */
.chart-replay-trading-panel .chart-panel-header {
cursor: move;
user-select: none;
touch-action: none;
background: var(--surface-raised);
}
.chart-replay-trading-panel .chart-panel-close {
cursor: pointer;
}
.chart-replay-trading-panel .chart-panel-drag {
color: var(--text-muted);
font-size: var(--font-sm);
letter-spacing: 0.08em;
line-height: 1;
}
.chart-replay-trading-panel.dragging {
opacity: 0.92;
transition: none;
}
.chart-replay-trading-body {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: var(--space-sm) var(--space-md);
display: flex;
flex-direction: column;
gap: var(--space-md);
}
.chart-replay-trading-config {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: var(--space-sm);
}
.chart-replay-trading-config .input-group {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-2xs);
}
.chart-replay-trading-config .input-field {
width: 100%;
min-width: 0;
padding: var(--space-xs) var(--space-sm);
font-size: var(--font-xs);
font-family: var(--font-mono);
}
.chart-replay-trading-actions {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: var(--space-xs);
}
.chart-rpt-btn {
font-size: var(--font-xs);
font-weight: 700;
letter-spacing: 0.04em;
padding: var(--space-sm);
border-radius: var(--radius-sm);
cursor: pointer;
transition: filter var(--transition-base);
text-transform: uppercase;
}
.chart-rpt-btn:disabled {
opacity: 0.4;
cursor: default;
pointer-events: none;
}
.chart-rpt-btn--buy {
background: color-mix(in srgb, var(--positive) 14%, transparent);
color: var(--positive);
border: 1px solid color-mix(in srgb, var(--positive) 50%, transparent);
}
.chart-rpt-btn--buy:hover:not(:disabled) {
filter: brightness(1.2);
}
.chart-rpt-btn--sell {
background: color-mix(in srgb, var(--negative) 14%, transparent);
color: var(--negative);
border: 1px solid color-mix(in srgb, var(--negative) 50%, transparent);
}
.chart-rpt-btn--sell:hover:not(:disabled) {
filter: brightness(1.2);
}
.chart-rpt-btn--close {
background: var(--surface-raised);
color: var(--text-secondary);
border: 1px solid var(--border);
}
.chart-rpt-btn--close:hover:not(:disabled) {
color: var(--text);
border-color: var(--text-muted);
}
.chart-replay-trading-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-xs);
border-top: 1px solid var(--border);
padding-top: var(--space-sm);
}
.chart-rpt-stat {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: var(--space-xs);
font-size: var(--font-xs);
padding: var(--space-2xs) 0;
}
.chart-rpt-stat-label {
color: var(--text-muted);
white-space: nowrap;
}
.chart-rpt-stat-value {
color: var(--text-primary);
font-family: var(--font-mono);
white-space: nowrap;
}
.chart-replay-trading-trades {
border-top: 1px solid var(--border);
padding-top: var(--space-xs);
font-size: var(--font-xs);
color: var(--text-muted);
display: flex;
flex-direction: column;
gap: var(--space-2xs);
}
.chart-rpt-open-title {
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
font-size: var(--font-xxs);
margin-bottom: var(--space-2xs);
}
.chart-rpt-open-row {
display: flex;
flex-direction: column;
gap: 1px;
padding: 3px var(--space-xs);
background: var(--surface-raised);
border-radius: var(--radius-sm);
border: 1px solid var(--border);
}
.chart-rpt-open-main {
display: grid;
grid-template-columns: auto 1fr auto auto;
align-items: center;
gap: var(--space-xs);
}
.chart-rpt-open-side {
font-weight: 700;
letter-spacing: 0.03em;
}
.chart-rpt-open-side--long {
color: var(--positive);
}
.chart-rpt-open-side--short {
color: var(--negative);
}
.chart-rpt-open-detail {
color: var(--text-secondary);
font-family: var(--font-mono);
}
.chart-rpt-open-pnl {
font-family: var(--font-mono);
text-align: right;
}
.chart-rpt-open-actions {
display: flex;
gap: var(--space-2xs);
}
.chart-rpt-open-close,
.chart-rpt-open-rev {
background: transparent;
border: none;
color: var(--text-muted);
font-size: var(--font-md);
line-height: 1;
cursor: pointer;
padding: 0 var(--space-xs);
border-radius: var(--radius-sm);
font-family: var(--font-sans);
}
.chart-rpt-open-close:hover {
color: var(--negative);
background: color-mix(in srgb, var(--negative) 12%, transparent);
}
.chart-rpt-open-rev:hover {
color: var(--accent);
background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.chart-rpt-open-brackets {
color: var(--text-muted);
font-family: var(--font-mono);
font-size: var(--font-xxs);
letter-spacing: 0.02em;
}
.chart-rpt-open-empty {
color: var(--text-muted);
text-align: center;
padding: var(--space-2xs) 0;
}
/* On-chart Replay Trading cluster (TradingView's Buy/Sell in the
chart's top-left corner). Lives inside the chart container and sits
just below the price legend. */
.chart-replay-trade-buttons {
position: absolute;
top: calc(var(--space-sm) + 22px);
left: var(--space-sm);
z-index: var(--z-10);
display: flex;
gap: var(--space-xs);
}
.chart-replay-trade-buttons.hidden {
display: none;
}
.chart-rpt-chart-btn {
background: var(--bg-elevated);
border: 1px solid var(--border);
color: var(--text-secondary);
font-family: var(--font-sans);
font-size: var(--font-xs);
font-weight: 600;
padding: 3px 10px;
border-radius: var(--radius-sm);
cursor: pointer;
letter-spacing: 0.03em;
transition: background var(--transition-instant) linear, color var(--transition-instant) linear, border-color var(--transition-instant) linear;
}
.chart-rpt-chart-btn:hover:not(:disabled) {
color: var(--text-primary);
background: var(--surface-raised);
border-color: var(--border);
}
.chart-rpt-chart-btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.chart-rpt-chart-btn--buy:hover:not(:disabled) {
color: var(--positive);
border-color: var(--positive);
}
.chart-rpt-chart-btn--sell:hover:not(:disabled) {
color: var(--negative);
border-color: var(--negative);
}
.chart-replay-trading-brackets {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-xs);
border-top: 1px solid var(--border);
padding-top: var(--space-sm);
}
.chart-replay-trading-brackets .input-group {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-2xs);
}
.chart-replay-trading-brackets .input-field {
width: 100%;
min-width: 0;
padding: var(--space-xs) var(--space-sm);
font-size: var(--font-xs);
font-family: var(--font-mono);
}
/* ββ Replay Trading session summary popup ββ */
.chart-replay-summary {
position: fixed;
inset: 0;
z-index: var(--z-100);
background: var(--scrim-60);
display: flex;
align-items: center;
justify-content: center;
}
.chart-replay-summary.hidden {
display: none;
}
.chart-replay-summary-modal {
background: var(--surface-raised);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
/* 420px is this modal's own width cap; the token with that value names a
chart's height, not a dialog width. */
width: min(420px, 90vw);
padding: var(--space-md);
display: flex;
flex-direction: column;
gap: var(--space-md);
}
.chart-replay-summary-header {
display: flex;
align-items: center;
gap: var(--space-sm);
border-bottom: 1px solid var(--border);
padding-bottom: var(--space-sm);
}
.chart-replay-summary-title {
font-size: var(--font-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-secondary);
}
.chart-replay-summary-header .chart-panel-close {
margin-left: auto;
}
.chart-replay-summary-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-xs);
}
.chart-replay-summary-actions {
display: flex;
justify-content: flex-end;
}
@media (width <= 1024px) {
.chart-replay-trading-config {
grid-template-columns: 1fr;
}
}
/* Advanced popover on the chart: each tool is a labelled row, not an icon alone. */
.ui-disclosure--popover .btn {
display: flex;
align-items: center;
justify-content: flex-start;
gap: var(--space-sm);
text-align: left;
}
.chart-advanced__label {
font-size: var(--font-sm);
}
/* =======================================
Chart Page - Unified with common.css
ONLY unique layout overrides. ALL variables from common.css.
Structural scaffold only β visual polish of sub-elements (dropdown
items, crosshair fine details, drawing-tool active states) is left
for the follow-up interactive-JS task.
======================================= */
body.chart-page {
display: flex;
flex-direction: column;
height: var(--viewport-h);
overflow: hidden;
}
.chart-shell {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ββ Top bar ββ */
.chart-topbar {
display: flex;
align-items: center;
gap: var(--space-md);
flex-wrap: wrap;
min-height: var(--toolbar-height);
padding: var(--space-xs) var(--space-sm);
background: var(--bg-elevated);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
/* On a small phone the topbar wraps into three or four rows and eats the
chart's height, so it gets tighter here to pay the chart back for
dropping its width floor (see the <=480px block). */
@media (width <= 480px) {
/* The watchlist's Full view button (25px tall) is below the audit's 28px
touch floor; the TradingView attribution link is in common.css. */
.chart-watchlist-header-btn {
display: inline-flex;
align-items: center;
min-height: var(--touch-floor);
}
.chart-topbar {
gap: var(--space-sm);
padding: var(--space-xs) var(--space-sm);
}
/* The action icons (refresh, alerts, indicators, date jumpβ¦) are wider than
a 360px phone. They wrap onto a second row instead of running off the
right edge, where the date jump was cut in half and could not be reached. */
.chart-topbar__actions {
flex-wrap: wrap;
margin-left: 0;
width: 100%;
}
}
.chart-topbar__symbol {
position: relative;
flex-shrink: 0;
}
.chart-symbol-input {
width: 140px;
background: transparent;
border-color: transparent;
font-size: var(--font-lg);
font-weight: 600;
}
.chart-symbol-input:focus,
.chart-symbol-input:hover {
background: var(--bg-elevated);
border-color: var(--border);
}
.chart-symbol-dropdown {
/* Surface from .surface (common.css); the rule owns the placement. */
position: absolute;
top: calc(100% + var(--space-2xs));
left: 0;
min-width: 260px;
max-height: 320px;
overflow-y: auto;
box-shadow: var(--shadow-md);
z-index: var(--z-100);
}
.chart-symbol-dropdown.hidden {
display: none;
}
.chart-timeframe-bar {
position: relative;