/* Google Fonts — single source of truth for the whole app's font stack. Barlow Condensed (headings via --font-heading), Inter (body via --font-sans), JetBrains Mono (Level 2 tape via --l2-font-mono). Pages no longer carry their own ; loading common.css loads the fonts. */ @import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;900&family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap'); /* Breakpoint tokens (static/CONVENTIONS.md, "Breakpoint tokens"). A custom property cannot appear inside @media, so the widths are literal numbers and this block is the one place they are named: --bp-phone: 480px @media (width <= 480px) --bp-tablet: 768px @media (width <= 768px) New and touched media queries use only these two widths. The other legacy widths (600, 640, 900, 1024, ...) stay until the rule that carries them is rewritten. */ /* stylelint-disable color-no-hex -- this is the token definition block itself */ :root { /* ── Colors: TradingView Dark Theme Paleta exactamente de TradingView */ /* Accent - TV style. Three colours have six live names. Every duplicate below is now an ALIAS rather than a second hex, so there is one value per colour and a reader can see that --danger and --negative cannot drift apart: #d1d4dc --accent --primary --text --text-primary #089981 --positive --success #f23645 --negative --danger The alias pairs are the TradingView spellings kept for the chart library and for the older call sites; --success-hover / --danger-hover keep their own values because a hover is a different colour, not an alias. */ --primary: var(--accent); --primary-hover: #e1e3e8; --secondary: #787b86; --secondary-hover: #9a9ea6; --danger: var(--negative); --danger-hover: #f65b68; --success: #065f46; --success-hover: #0ab08f; --warning: #a65b00; --warning-rgb: 240 185 11; --chart-marker: #fff; --premarket-band: rgb(255 187 0 / 8%); /* Drawing-tool chrome. The horizontal line, the trend line and the selected-drawing highlight used to borrow --info, --corporate and --warning, and the last two are #f59e0b against #f0b90b: one shade apart, so selecting an amber trend line left it looking unselected. Tool chrome gets its own three colours here; no semantic token changes, and the semantic tokens keep every non-drawing use they already had. */ --draw-hline: #2962ff; --draw-trend: #f59e0b; --draw-selected: #22d3ee; --postmarket-band: rgb(41 98 255 / 8%); --warning-text: #d97706; /* darker amber for text on dark bg (vs. bright --warning used for accents) */ /* ── The ambers, and which one you want ───────────────────────────────── Four amber tokens with no selection rule is how --corporate ended up holding Tailwind's amber-500 (#f59e0b) in a TradingView palette: --warning #f0b90b a FILLED amber (badge fill, chart marker) --warning-text #d97706 amber TEXT on a dark surface --catalyst #e3b341 an event that is news before it is a trade --corporate deleted: #f59e0b, one shade from --warning, with one reader (a corporate-action highlight) whose meaning is --catalyst. --corporate-rgb had no reader at all. --draw-trend keeps #f59e0b: that one IS a drawing tool's own colour and the reason it exists is to NOT look like --warning. */ --info: #2962ff; /* Surfaces - TV dark palette */ --bg: #0e0f15; --bg-elevated: #191a24; --bg-secondary: #232432; --bg-tertiary: #232432; --bg-input: #191a24; --surface: #191a24; --bg-surface: var(--surface); --surface-raised: #232432; --bg-primary: var(--bg-elevated); /* Text - research palette */ --text: #e6e6ea; --text-primary: var(--text); --text-secondary: #93939e; /* Borders - research palette */ --border: #2e2f41; /* A focus ring is a non-text indicator: WCAG 2.1 SC 1.4.11 asks 3:1 against the adjacent colour. At #3d3d52 it measured 1.81:1 on --bg, so a keyboard user could not see where the ring was. #6b6b8a is 3.73:1 -- above the floor, still native to the border family. */ --border-focus: #6b6b8a; /* Muted is the tier most text actually lands on, and it sits on cards as often as on the page: at #828694 it read 4.38:1 on --surface. Lifted to the nearest value that clears 4.5:1 on all four dark surfaces (5.92 / 5.25 / 4.75 / 4.72). --text-dim stays below it — dim is for axis labels and placeholder meta, and its own debt row in check-contrast.py is where that finding is tracked. */ --text-muted: #9094a2; --text-dim: #88909c; --text-disabled: #363a45; /* Borders - TV subtle (unified to research palette) */ /* Semantic colors - TV bright */ --accent: #e6e6ea; --positive: #55c465; --positive-rgb: 85 196 101; --negative: #e15447; --negative-rgb: 225 84 71; --catalyst: #e3b341; --catalyst-rgb: 227 179 65; --black: #000; --black-rgb: 0 0 0; /* Ink for text sitting on a solid fill. --on-accent is the one owner: --on-primary, --on-success and --l2-bg-contrast used to spell the same #131722, which is how a fifth name (--text-on-accent, P0.1) managed to look plausible. --on-danger is the same ink and always was a bad default: white on --danger measured 3.90:1 while this reads 4.59:1. The light island below re-declares it white, because its --danger is dark and white is the only ink that reaches AA there. */ --on-accent: #131722; --on-danger: #131722; /* Status text ON a status tint. The fill above stays at the TradingView value the chart palette is built on; at 12% over a card that green reads 3.86:1, under AA for the 12px type .badge uses. These are the same hues lifted until they clear 4.5:1 on every surface a tint can land on, at the 12% resting tint AND the 20% a hover deepens it to (.reversal-btn.active:hover and its neighbours) — worst case 4.6. */ --positive-text: #0abc9e; --negative-text: #f67c85; --info-text: #789dff; /* Semantic backgrounds - TV style */ --positive-bg: rgb(8 153 129 / 12%); --negative-bg: rgb(243 54 69 / 12%); --warning-bg: rgb(240 185 11 / 12%); --catalyst-bg: rgb(227 179 65 / 13%); --info-bg: rgb(41 98 255 / 12%); --accent-bg: rgb(209 212 220 / 6%); /* ── Border radius ── */ --radius-sm: 2px; --radius-md: 4px; --radius-lg: 6px; --radius-xl: 8px; --radius-none: 0; --radius-round: 50%; /* ── Spacing ── */ --touch-target-size: 36px; /* dense touch target: the compact minimum on phones */ --aside-width: 380px; /* a side panel next to the main column */ --chart-stage-height: 420px; /* a chart card that stands alone in a column */ --space-2xs: 2px; --space-xs: 4px; --space-xs-plus: 6px; --space-sm-plus: 12px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px; --space-xxl: 48px; /* ── Font scale ── */ --font-xs: 0.6875rem; --font-xxs: 0.625rem; /* 10px — micro labels */ --font-sm: 0.75rem; --font-md: 0.8125rem; --font-lg: 0.9375rem; --font-xl: 1.0625rem; --font-xxl: 1.25rem; --font-xxxl: 1.5rem; --font-display: 1.75rem; /* off-scale display size, Wave 4.3 */ --font-hero: 2.25rem; /* off-scale hero size, Wave 4.3 */ /* 14px, the one step the scale has no name for: --font-md is 13 and --font-lg is 15. Named for its first two readers, the "x" on a tab close and on a filter row (.analyze-tab-close, .filter-remove); the third is the phone-layout P&L chip in the trades calendar, which bumps to 14px for legibility in a full-width row and owes the scale a step of its own (Wave 4.3). It was called --font-base, which is a misnomer twice over: nothing in this app sets a base font size, so the real base is 16px. */ --font-icon: 0.875rem; /* ── Z-Index Scale ── One owner per layer, documented so a new z-index can be placed instead of invented. Pick the row that matches the element's ROLE, never a number between rows. | Capa | Token | Elementos | |-------|----------------------|----------------------------------------------------| | 1 | --z-1 | thead sticky, celdas fijas de tabla | | 2 | --z-2 | leyenda de chart (session label / ohlc) | | 5 | --z-5 | resize handle, hijos flotantes de panel docked | | 10 | --z-10 | botón de fullscreen chart, botones de panel docked | | 50 | --z-50 | scrim de panel overlay de chart, bottom-sheet | | 100 | --z-100 | sheet de trades, popovers de chart | | 199 | --z-199 | (reservado, sin owner hoy | | 200 | --z-200 | scrim del drawer de navegación | | 500 | --z-500 | sidebar de navegación | | 1000 | --z-1000 | modal overlay, alerts panel, fullscreen chart | | 1001 | calc(--z-1000 + 1) | tooltip flotante | | 10000 | --z-max | chat modal, diálogos flotantes | Nota: el botón de menú flotante (#nav-toggle-float) NO vive en --z-1000 — se bajó a --z-200 para que el modal sea owner del corner superior izquierdo cuando está abierto. */ --z-1: 1; --z-2: 2; --z-5: 5; --z-10: 10; --z-50: 50; --z-100: 100; --z-199: 199; --z-200: 200; --z-500: 500; --z-1000: 1000; --z-max: 10000; /* ── Transitions ── */ /* The motion scale: five steps, nothing between them. A duration that is not one of these is a decision nobody drew. Keyframe periods are NOT on this scale — a loop's period is how often it repeats, not how long a thing takes to move. */ --transition-instant: 0.08s ease; --transition-fast: 0.1s ease; --transition-base: 0.15s ease; --transition-slow: 0.25s ease; --transition-slower: 0.4s ease; /* ── Fonts ── */ --font-sans: inter, -apple-system, blinkmacsystemfont, "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", sans-serif; --font-mono: "JetBrains Mono", "Consolas", "Lucida Console", "Monaco", monospace; --font-heading: "Barlow Condensed", var(--font-sans); /* ── Shadows ── */ --shadow-sm: 0 1px 3px color-mix(in srgb, var(--black) 40%, transparent); --shadow-md: 0 4px 12px color-mix(in srgb, var(--black) 50%, transparent); --shadow-lg: 0 8px 24px color-mix(in srgb, var(--black) 60%, transparent); /* Named translucent tints (theme-independent alpha colours) */ --scrim-60: rgb(0 0 0 / 60%); --scrim-25: rgb(0 0 0 / 25%); --shade-4: rgb(0 0 0 / 4%); --shade-7: rgb(0 0 0 / 7%); --shade-10: rgb(0 0 0 / 10%); --shade-14: rgb(0 0 0 / 14%); --ink-scrim-70: rgb(10 10 10 / 70%); --neutral-15: rgb(102 102 102 / 15%); --neutral-12: rgb(120 123 134 / 12%); --neutral-20: rgb(120 123 134 / 20%); --info-18: rgb(0 168 255 / 18%); --info-10: rgb(27 79 189 / 10%); --warning-18: rgb(255 193 7 / 18%); --warning-10: rgb(122 92 0 / 10%); --positive-10: rgb(10 106 82 / 10%); --negative-10: rgb(161 29 44 / 10%); /* ── Overlay scale ── white overlays on dark surfaces (hover / zebra / dividers) */ --overlay-1: rgb(255 255 255 / 3%); --overlay-2: rgb(255 255 255 / 6%); --overlay-3: rgb(255 255 255 / 8%); --overlay-4: rgb(255 255 255 / 12%); /* Info channel for rgba() usage (matches --info #2962ff) */ --info-rgb: 41 98 255; /* Glass surface for dialogs (matches --bg-elevated #1e222d at 0.85) */ --glass-bg: rgb(30 34 45 / 85%); --glass-border: rgb(255 255 255 / 8%); /* ── Level 2 Trading Terminal tokens ── Aliases of the global app tokens: the Level 2 / Time & Sales panel shares the application's palette instead of carrying its own. */ --l2-text: var(--text); --l2-bg: var(--bg-elevated); --l2-accent: var(--accent); --l2-accent-hover: var(--primary-hover); --l2-bid: var(--positive); --l2-ask: var(--negative); --l2-panel: var(--bg-elevated); --l2-panel-border: var(--border); --l2-border-width: 1px; /* Level 2 font stack: same mono as the rest of the app */ --l2-font-mono: var(--font-mono); /* ── Layout tokens (panel widths, toolbar, chart, header) ── */ --control-height: 26px; /* ── Inline SVG icons ────────────────────────────────────────────────── One stroke for every inline icon, at either grid: 1.6 reads the same at a 24px nav icon and an 11px chart-card one, which is why the tree had four values for what is one decision. `stroke-width` is a presentation ATTRIBUTE in the markup and an attribute cannot read a custom property, so the rule that owns it is `svg[stroke="currentColor"]` below and the attribute is simply absent. */ --icon-stroke: 1.6; --icon-size: 20px; /* the CSS-sized 24-grid icons: nav links, toolbar buttons */ --spinner-size: 24px; /* .spinner ring box */ --nav-float-size: 44px; /* #nav-toggle-float: the touch minimum; the 20px glyph sits inside the padding */ --panel-width-md: 380px; --panel-width-xl: 700px; --chart-min-width: 360px; /* Offset subtracted from 100dvh so .trades-layout fills the viewport's free vertical space. Trades has no page header: only the page-wrapper's top padding (space-sm = 8px) and bottom padding (space-xl = 32px). */ --trades-layout-offset: 40px; --dash-card-min: 380px; --split-card-min: 400px; --split-card-min-mobile: 280px; --presets-card-min: 14em; /* ── Semantic height/width tokens (dashboard/backtest magic numbers) ── */ --chart-height-default: 420px; --picker-list-height: 220px; /* ── Dialog widths: three sizes, no more. A dialog that does not fit one of them needs its layout built to fit one of them; the two exceptions (the risk calculator, the chat panel) carry the reason inline. ── */ --dialog-width-sm: 480px; --dialog-width-md: 640px; --dialog-width-lg: 780px; /* ── Viewport ── One place that knows how tall "the whole screen" is, so pages don't each spell out the vh/dvh pair. The vh line is the fallback for browsers without dvh. */ --viewport-h: 100vh; /* stylelint-disable-next-line declaration-block-no-duplicate-custom-properties -- the vh line above IS the fallback; a browser without dvh drops this one and keeps it */ --viewport-h: 100dvh; --safe-b: env(safe-area-inset-bottom, 0px); /* ── Touch ── */ --touch-min: 44px; /* Floor for controls on tablet/phone widths: under the 44px touch target, but well above the compact desktop size. */ --touch-compact: 40px; /* The responsive audit's floor for a tap target (scripts/responsive-audit.mjs): below the 44px touch minimum, but a target a thumb can still hit. Used where a small glyph button or a sort header cannot take the full minimum. */ --touch-floor: 28px; /* Phone height of the scan day chart (scan.css, width <= 480px). 40dvh put the first results row at y=642 at 390x844, with the results header at y=565; 36dvh brings the table header and the first six rows onto the first screen. Measured during the mobile UI rebuild (MOB-16 step 2). */ --scan-chart-phone-height: 36dvh; /* ── Shared control, tab and table geometry ── One value per property. A component that needs a different size names its own modifier and sets it from these tokens, never a literal. */ --control-font-size: var(--font-sm); --tab-height: 28px; --tab-font-size: var(--font-sm); --toolbar-height: 36px; --page-title-size: var(--font-lg); --card-title-margin: var(--space-sm); /* Focus ring: one 2px ring and offset for every :focus-visible outline. */ --focus-ring-width: 2px; --focus-ring-offset: 2px; /* ── Data density ── */ --table-cell-pad-y: 6px; --table-cell-pad-x: var(--space-sm); --table-font-size: var(--font-sm); /* ── Native control theming ── The app is dark end to end, but the UA form-control palette is light unless the document opts in. Stated once here so the 28 number inputs, the 10 date inputs, 7 radios, 4 checkboxes, 2 time inputs, the file input and the scrollbars all render dark instead of each stylesheet patching its own control. */ color-scheme: dark; accent-color: var(--accent); } /* stylelint-enable color-no-hex */ * { box-sizing: border-box; } /* ── Native form-control surfaces ────────────────── The date picker glyph is the one control the UA still draws with its own light artwork on a dark field. Stated once for every date input instead of the single stylesheet that used to carry it. Number inputs keep their native steppers: the Backtest and Scanner PDF offset fields are stepped through them, and `color-scheme: dark` above is what themes them, so there is nothing to suppress. */ input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; } body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); min-height: var(--viewport-h); line-height: 1.5; /* Better readability */ --sidebar-w: 56px; padding-left: var(--sidebar-w); /* The content offset and the sidebar it clears are the same measurement in two places: --sidebar-w drives this padding-left and nav.main-nav's width. The nav animates its width (below), so without a matching transition here the two disagree for the length of the animation and the sidebar's right edge sweeps across the content. */ transition: padding-left var(--transition-base); } /* dvh fallback for full-viewport elements */ @supports (height: 100dvh) { .modal-overlay { height: 100dvh; } } .container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 var(--space-md); } .page-wrapper { max-width: 1600px; margin: 0 auto; width: 100%; padding: var(--space-sm) var(--space-md) var(--space-xl); } /* ── Vertical Sidebar ──────────────────────────────── Fixed on the left edge, full height. Collapsed by default (icons only, 56px) to maximize content width; toggled expanded (200px) via the hamburger. `--sidebar-w` lives on so body-left padding and nav width stay in sync; .sidebar-expanded widens both. */ body.sidebar-expanded { --sidebar-w: 200px; } nav.main-nav { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--border); z-index: var(--z-500); /* Pairs with body's padding-left transition above: the two must animate over the same duration or the seam is visible mid-toggle. */ transition: width var(--transition-base); overflow: hidden; } /* Floating hamburger for mobile drawers — hidden on desktop */ #nav-toggle-float { display: none; } /* Sidebar toggle row + brand */ .sidebar-toggle-wrap { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-sm); border-bottom: 1px solid var(--border); flex-shrink: 0; } .nav-brand { display: flex; align-items: center; gap: var(--space-sm); white-space: nowrap; flex: 1; min-width: 0; } .nav-brand-mark { font-family: var(--font-heading); /* 900 is the one weight that stays: the heading face is Barlow Condensed, loaded at 700 and 900 only, so this is a real cut of the brand face rather than a stray in a 400/600/700 stack. */ font-weight: 900; font-size: var(--font-xl); color: var(--accent); letter-spacing: 0.05em; white-space: nowrap; } .nav-brand-label { white-space: nowrap; } /* Nav links: vertical stack, flex to fill */ .nav-links { display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; padding: var(--space-sm); overflow: hidden auto; scrollbar-width: none; } .nav-links::-webkit-scrollbar { display: none; } nav.main-nav a, nav.main-nav .nav-search-btn { display: flex; align-items: center; gap: var(--space-sm); font-family: var(--font-sans); font-size: var(--font-sm); font-weight: 600; text-decoration: none; color: var(--text-muted); padding: var(--space-sm); border-radius: var(--radius-md); transition: all var(--transition-fast); white-space: nowrap; flex-shrink: 0; width: 100%; border: none; background: none; cursor: pointer; } nav.main-nav a:hover, nav.main-nav .nav-search-btn:hover { color: var(--text); background: var(--border); } nav.main-nav a.active { background: var(--accent); color: var(--bg); } nav.main-nav a svg, nav.main-nav .nav-search-btn svg { width: var(--icon-size); height: var(--icon-size); flex-shrink: 0; } /* The one place an inline icon's stroke is written. Scoped by the attribute every stroked icon already carries, so a filled icon (fill="currentColor", no stroke) is untouched and no class has to be invented. The chart-card shadow root repeats this rule inside its own scope — a shadow tree does not inherit the document's selectors, only its variables. */ svg[stroke="currentColor"] { stroke-width: var(--icon-stroke); } /* Labels: hidden while collapsed, shown when expanded */ .nav-label, .nav-brand-label { font-size: var(--font-sm); font-weight: 600; white-space: nowrap; transition: opacity var(--transition-fast); } body:not(.sidebar-expanded) .nav-label, body:not(.sidebar-expanded) .nav-brand-label { display: none; } body:not(.sidebar-expanded) .nav-brand { display: none; } /* Watchlist badge in nav — hidden by default, shown only with .has-items */ nav.main-nav a .nav-badge { display: none; } nav.main-nav a .nav-badge.has-items { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: var(--space-xs); border-radius: var(--radius-round); background: var(--accent); color: var(--bg); font-size: var(--font-xs); font-weight: 700; line-height: 1; vertical-align: middle; } nav.main-nav a.active .nav-badge.has-items { background: var(--bg); color: var(--accent); } nav.main-nav .nav-actions { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-sm); border-top: 1px solid var(--border); flex-shrink: 0; } nav.main-nav .nav-toggle { display: flex; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: var(--space-sm); border-radius: var(--radius-md); transition: all var(--transition-fast); flex-shrink: 0; } nav.main-nav .nav-toggle:hover { color: var(--text); background: var(--border); } nav.main-nav .nav-toggle svg { width: var(--icon-size); height: var(--icon-size); display: block; } .control-panel { /* Surface from .surface (this file); the rule owns the panel's spacing. */ padding: var(--space-md); margin-bottom: var(--space-md); } /* Control Panel Modifiers (BEM-lite) */ .control-panel--compact { padding: var(--space-sm); margin-bottom: var(--space-sm); } /* Unified Control Panel BEM Structure */ .control-panel__main { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; position: relative; } .control-panel__secondary { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; padding-top: var(--space-sm); margin-top: var(--space-sm); border-top: 1px solid var(--border); } .control-panel__secondary.hidden { display: none; } .control-panel__toggle { 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; transition: all var(--transition-fast); margin-left: auto; } .control-panel__toggle:hover { border-color: var(--accent); color: var(--text); } .control-panel__toggle.active { background: var(--accent); color: var(--bg); border-color: var(--accent); } /* ── Panel resize seams (shared by every page) ───────────────────────── The drag handle a `features/shared/splitter.ts` binding rides on: a 10px hit area over a 1px rule that only appears on hover, drag or focus. Positioning stays per page — the seam sits wherever that page's layout puts it (the splitter's size variable is the one offset both the panel and the handle read). `--resize-offset` is the shared offset hook: when a page sets it, the handle rides that distance from the container's edge; when it is absent or invalid, `auto` leaves the handle at its static position, which is what a seam that has not been dragged yet needs. */ .panel-resize-handle { position: absolute; inset-block: 0; width: 10px; margin-left: -5px; cursor: col-resize; touch-action: none; z-index: var(--z-10); } .panel-resize-handle::after { content: ""; position: absolute; inset-block: 0; left: 50%; width: 1px; margin-left: -0.5px; background: var(--border); opacity: 0; transition: opacity var(--transition-base); } /* The row-seam twin of the handle above: same affordance, riding a horizontal seam. One class with the axis flipped, so the visual contract (10px of grab area, touch-action off, a focus ring) cannot drift. */ .panel-resize-handle--row { inset-block: auto; inset-inline: 0; top: var(--resize-offset, auto); width: auto; height: 10px; margin-left: 0; margin-top: -5px; cursor: row-resize; } .panel-resize-handle--row::after { inset-block: auto; inset-inline: 0; top: 50%; left: 0; width: auto; height: 1px; margin-left: 0; margin-top: -0.5px; } .panel-resize-handle:hover::after, .panel-resize-handle.dragging::after, .panel-resize-handle:focus-visible::after { background: var(--accent); opacity: 1; } .panel-resize-handle:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: -2px; } .input-row, .filter-row, .action-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; } .input-row > *, .filter-row > *, .action-row > * { flex-shrink: 0; } .input-group { display: flex; flex-direction: column; gap: var(--space-sm); } .input-label { font-family: var(--font-sans); font-size: var(--font-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; } .input-field, .select-field, .filter-textarea, .modal-input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-sans); font-size: var(--control-font-size); color: var(--text); transition: border-color var(--transition-fast); min-width: 150px; } .filter-textarea, .modal-input { padding: var(--space-sm) var(--space-md); } /* One control height for the single-line fields: the text centres in it. */ .input-field, .select-field { height: var(--control-height); padding: 0 var(--space-md); } /* The compact geometry (filter rows, inline selectors, toolbar fields), so a page that wants a short field asks for it instead of writing padding. */ .input-field--sm, .select-field--sm { height: var(--control-height); padding: 0 var(--space-sm); } .modal-input--sm { padding: var(--space-xs) var(--space-sm); font-size: var(--control-font-size); } .input-field--upper { text-transform: uppercase; } .input-field:focus, .select-field:focus, .filter-textarea:focus, .modal-input:focus { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-color: var(--accent); } .input-field::placeholder, .filter-textarea::placeholder, .modal-input::placeholder { color: var(--text-muted); opacity: 0.5; } .filter-textarea { flex: 1; min-height: var(--touch-min); max-height: 150px; resize: vertical; } /* One height and one font size for every button; .btn is the only button shape. */ .btn { font-family: var(--font-sans); font-weight: 600; font-size: var(--control-font-size); height: var(--control-height); padding: 0 var(--space-md); border-radius: var(--radius-md); border: 1px solid var(--border); cursor: pointer; transition: all var(--transition-fast); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; background: var(--bg); color: var(--text); } .btn:hover { background: var(--border); color: var(--text); } .btn:active { transform: scale(0.98); } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn-primary { background: var(--primary); color: var(--bg); border-color: var(--primary); } .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); } .btn-secondary { background: var(--bg-elevated); color: var(--secondary); border-color: var(--border); } .btn-secondary:hover { background: var(--border); color: var(--text); } .btn-danger { background: var(--danger); color: var(--bg); border-color: var(--danger); } .btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); } /* ── Icon button (unified — was duplicated per-page in dashboard.css/backtest.css) ── */ .btn-icon { background: none; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; line-height: 1; color: var(--text-secondary); transition: all var(--transition-fast); } .btn-icon:hover { background: var(--bg-input); color: var(--text-primary); } .tf-selector { display: flex; gap: var(--space-xs); background: var(--bg); padding: var(--space-xs); border-radius: var(--radius-md); } @media (width <= 768px) { .tf-selector { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; } .tf-selector::-webkit-scrollbar { display: none; } .tf-selector .tf-btn { flex-shrink: 0; } } /* Segment buttons share the tab height, font and padding; the bordered strip is the only thing that tells them apart from .tab. */ .tf-selector .tf-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tab-height); font-family: var(--font-sans); background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); padding: 0 var(--space-md); font-size: var(--tab-font-size); font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-base); } .tf-selector .tf-btn:hover { border-color: var(--accent); color: var(--text); } .tf-selector .tf-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); } .view-toggle { display: flex; gap: var(--space-2xs); background: var(--bg); padding: var(--space-2xs); border-radius: var(--radius-md); border: 1px solid var(--border); } .view-toggle .view-btn { font-family: var(--font-sans); background: transparent; border: none; color: var(--text-muted); min-height: var(--control-height); padding: 0 var(--space-sm); font-size: var(--font-xs); font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-base); text-transform: uppercase; letter-spacing: 0.05em; } .view-toggle .view-btn:hover { color: var(--text); } .view-toggle .view-btn.active { background: var(--accent); color: var(--bg); } /* ── Tab bars: .tabs / .tab / .tab--active ────────────────────────────────── One tab button for the whole app. The row is `.tabs` and it scrolls when its tabs do not fit (eleven At Risk tabs overflow any phone), so the page never has to. Everything else about a tab bar — where it sits, whether it carries a border-bottom, how wide the pane below it is — stays the page's; only the button is shared. A page that needs a different button wants a different component, not a fifth spelling of this one. */ .tabs { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; } /* In a control panel the tab row takes the free width and scrolls, so the action beside it (Refresh) stays on the same line instead of wrapping. */ .control-panel__main > .tabs { flex: 1 1 0; } .tabs::-webkit-scrollbar { display: none; } .tab { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: var(--tab-height); scroll-snap-align: center; font-family: var(--font-sans); font-size: var(--tab-font-size); font-weight: 600; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--text-secondary); padding: 0 var(--space-md); white-space: nowrap; cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast); } .tab:hover { background: var(--overlay-1); color: var(--text-primary); } /* The selected chip every other selector in the tree already uses (nav a.active, .control-panel__toggle.active, .tf-btn.active): accent surface, background-coloured text for the contrast. */ .tab--active, .tab--active:hover { background: var(--accent); color: var(--bg); } .results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: var(--space-md); } .grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: var(--space-md); } .list-layout { display: flex; flex-direction: column; gap: var(--space-xs); /* Was declared a second time ~1,700 lines down, in the horizontal-scroll group. Both rules are one class with the same specificity, so the split bought nothing and only let the two halves drift apart. */ overflow-x: auto; } .status { font-family: var(--font-sans); font-size: var(--font-sm); color: var(--text-muted); padding: var(--space-lg); text-align: center; } /* ── State cards: .state + one variant ───────────────────────────────────── The one box for "nothing is here yet", "still fetching" and "that failed". Only three variants, deliberately: a fourth state means a component that happened to arrive in this shape, and it should keep its own class. `.status-empty` / `.status-loading` / `.status-error` are the same rule: discover-page.ts is PROTECTED and still writes them. Delete the aliases when that file is released. */ .state, .status-empty, .status-loading, .status-error { padding: var(--space-xl) var(--space-md); text-align: center; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-muted); font-size: var(--font-sm); } .state--loading, .state--empty { color: var(--text-muted); } .state--error, .status-error { color: var(--negative); border-color: var(--negative); } .state--spaced { margin: var(--space-md) 0; } /* Generic loading/error placeholders (promoted from reverse-splits page) */ .loading-state { text-align: center; padding: var(--space-xxl) var(--space-md); color: var(--text-muted); font-size: var(--font-md); } .card-title { font-weight: 600; font-size: var(--font-lg); margin-bottom: var(--card-title-margin); } .card-subtitle { font-family: var(--font-sans); font-size: var(--font-xs); color: var(--text-muted); } .metric-label { font-family: var(--font-sans); font-size: var(--font-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: var(--space-xs); } .metric-value { font-family: var(--font-sans); font-size: var(--font-md); font-weight: 700; color: var(--text); } .metric-value.positive { color: var(--positive); } .metric-value.negative { color: var(--negative); } .metric-value.accent { color: var(--accent); } .badge { display: inline-block; padding: 3px var(--space-sm); border-radius: var(--radius-md); font-size: var(--font-sm); font-weight: 600; text-transform: uppercase; } /* The tier modifiers are the whole contract: geometry lives on `.badge`, a modifier carries colour and nothing else. `--sm` is the only size variant, for the families whose chips were a step smaller than the default. */ .badge--sm { padding: var(--space-2xs) var(--space-sm); font-size: var(--font-xs); } .badge--positive { background: var(--positive-bg); color: var(--positive-text); } .badge--negative { background: var(--negative-bg); color: var(--negative-text); } .badge--neutral { background: var(--neutral-15); color: var(--text-muted); } .badge--info { background: var(--info-bg); color: var(--info-text); } /* Symbol flags — emoji badges rendered next to a symbol. */ .symbol-flag { display: inline-block; margin-left: var(--space-xs); font-size: var(--font-sm); cursor: help; } .symbol-flag-more { color: var(--text-muted); font-weight: 600; } .modal-overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--black) 80%, transparent); display: flex; align-items: center; justify-content: center; z-index: var(--z-1000); } .modal-overlay.hidden { display: none; } body.modal-open { overflow: hidden; } .modal-content { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-lg); width: var(--dialog-width-sm); max-width: 95vw; max-height: 85vh; max-height: 85dvh; overflow-y: auto; } /* The width belongs here, not on a page's own dialog class: a dialog that picks its width by hand is how 350/420/520/560/640/780/980 got into the tree in the first place. sm is the default, so only the other two are opt-in. */ .modal-content--md { width: var(--dialog-width-md); } .modal-content--lg { width: var(--dialog-width-lg); } /* Symbol Flags dialog — list view management */ .symbol-flags-dialog { display: flex; flex-direction: column; } .symbol-flags-dialog__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); } .symbol-flags-dialog__body { flex: 1; min-height: 0; overflow-y: auto; } .symbol-flags-dialog__error { padding: var(--space-xl); text-align: center; color: var(--text-muted); } .symbol-flags-dialog__empty { padding: var(--space-xxl) var(--space-md); text-align: center; } .symbol-flags-dialog__empty p { color: var(--text-muted); margin-bottom: var(--space-md); } .symbol-flags-dialog__new-btn { margin: 0 auto; } .symbol-flags-list { list-style: none; margin: 0; padding: 0; } .symbol-flags-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); } .symbol-flags-row:last-child { border-bottom: none; } .symbol-flags-row__drag { width: 1.25em; height: 1.25em; display: flex; align-items: center; justify-content: center; cursor: grab; color: var(--text-dim); font-size: var(--font-sm); flex-shrink: 0; } .symbol-flags-row__move-btns { display: none; flex-direction: column; width: 1.25em; height: 1.25em; justify-content: center; gap: 0; } .symbol-flags-row__move-up, .symbol-flags-row__move-down { width: 1.25em; height: 0.875em; padding: 0; font-size: var(--font-xs); } .symbol-flags-row__emoji { font-size: var(--font-lg); width: 1.5em; text-align: center; flex-shrink: 0; } .symbol-flags-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .symbol-flags-row__summary { color: var(--text-muted); font-size: var(--font-sm); min-width: 100px; text-align: right; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .symbol-flags-toggle { appearance: none; border: 1px solid var(--border); border-radius: var(--radius-round); width: 52px; height: var(--control-height); position: relative; background: var(--border); cursor: pointer; padding: 0; transition: all var(--transition-fast); flex-shrink: 0; } .symbol-flags-toggle--on { background: color-mix(in srgb, var(--positive) 20%, transparent); border-color: var(--positive); } .symbol-flags-toggle__track { position: absolute; top: 3px; left: 3px; width: var(--icon-size); height: var(--icon-size); border-radius: var(--radius-round); background: var(--text); transition: transform var(--transition-fast); } .symbol-flags-toggle--on .symbol-flags-toggle__track { /* A 26px slide distance, not a control height: --control-height has the same value but names a control, so it is not reused here. */ transform: translateX(26px); } .symbol-flags-toggle__label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: var(--font-xxs); font-weight: 600; color: var(--text-dim); } .symbol-flags-toggle--on .symbol-flags-toggle__label { color: var(--positive); } .symbol-flags-row__actions { display: flex; align-items: center; gap: var(--space-xs); flex-shrink: 0; } .symbol-flags-row__edit, .symbol-flags-row__duplicate, .symbol-flags-row__delete { width: 1.5em; height: 1.5em; padding: 0; font-size: var(--font-sm); } .symbol-flags-row__confirm { display: flex; align-items: center; gap: var(--space-xs); } .symbol-flags-row__confirm-text { color: var(--text-muted); font-size: var(--font-xs); } .symbol-flags-row__confirm-yes, .symbol-flags-row__confirm-no { width: 1.75em; height: 1.5em; padding: 0; font-size: var(--font-xs); } .symbol-flags-row--drag-over { background: var(--overlay-2); } .symbol-flags-row--dragging { opacity: 0.5; } /* Narrow/touch: hide drag handle, show move buttons */ @media (width <= 768px) { .symbol-flags-row__drag { display: none; } .symbol-flags-row__move-btns { display: flex; } } /* Full-screen below dialog width */ /* Card-density scale: every content grid walks down one step at each of the 4 documented breakpoints (lg/md/sm/xs) so 1440→1280→1024→768→480 stays homogeneous instead of each page inventing its own 1400/900/700/etc. Families that already use min(Npx,100%) own their own --*-card-min token; the generic fallback (.results-grid/.grid-layout) keeps its 340→320 steps as the lowest-density tier. */ @media (width <= 1400px) { .results-grid, .grid-layout { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); } } @media (width <= 1024px) { .dash-grid, .split-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--dash-card-min), 100%), 1fr)); } /* .action-row stacks a column earlier than the other two row patterns: the buttons inside it are long enough that a row of them wraps into an unreadable two-line mess on a tablet. It lives here, with the class, instead of being re-declared in the page that first needed it. */ .action-row { flex-direction: column; align-items: stretch; } } @media (width <= 768px) { .results-grid, .grid-layout { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); } .dash-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--dash-card-min), 100%), 1fr)); } .split-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--split-card-min-mobile), 100%), 1fr)); } .presets-panel { grid-template-columns: repeat(auto-fill, minmax(min(var(--presets-card-min), 100%), 1fr)); } .input-row, .filter-row { flex-direction: column; align-items: stretch; } .input-row > *, .filter-row > * { flex-shrink: 1; } .input-field, .select-field, .modal-input { width: 100%; } .input-field, .modal-input { min-width: 0; } .inspector-metrics { grid-template-columns: repeat(2, 1fr); } .modal-content { width: 100%; max-width: 95vw; margin: 0 var(--space-sm); } /* Cards stacked instead of side-by-side */ .split-charts { grid-template-columns: 1fr; } .split-charts stock-chart-card:first-child { border-right: none; border-bottom: 1px solid var(--border); } /* Mobile touch targets: controls meant to be tapped need ≥ ~36px hit area. The compact paddings above are desktop-optimized. */ .control-panel__toggle { padding: 7px var(--space-sm); } .unified-chart-action-btn { min-width: var(--toolbar-height); min-height: var(--toolbar-height); padding: var(--space-sm); } } /* intentional breakpoint: 640px matches the dialog full-screen spec */ @media (width <= 640px) { .modal-content--md.symbol-flags-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: var(--radius-none); } } /* Symbol Flags dialog — editor view (compact) */ .symbol-flags-editor { display: flex; flex-direction: column; gap: var(--space-sm); padding-bottom: var(--space-sm); } .symbol-flags-editor__head { display: flex; align-items: center; gap: var(--space-sm); } .symbol-flags-editor__back { width: 1.75em; height: 1.75em; padding: 0; font-size: var(--font-md); } .symbol-flags-editor__heading { font-size: var(--font-md); font-weight: 600; color: var(--text); } .symbol-flags-editor__identity { display: flex; gap: var(--space-sm); align-items: flex-start; } .symbol-flags-editor__field { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; flex: 1; } .symbol-flags-editor__field--emoji { position: relative; flex: 0 0 auto; min-width: 88px; } .symbol-flags-editor__emoji-control { display: flex; align-items: stretch; gap: 0; } .symbol-flags-editor__label { font-size: var(--font-xs); font-weight: 600; color: var(--text-muted); } .symbol-flags-editor__input, .symbol-flags-editor__select { font-size: var(--font-md); padding: var(--space-xs) var(--space-sm); } .symbol-flags-editor__emoji-input { width: 2.8em; text-align: center; border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); } .symbol-flags-editor__emoji-trigger { padding: 0 var(--space-xs-plus); font-size: var(--font-xs); line-height: 1; background: var(--bg); border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-muted); cursor: pointer; } .symbol-flags-editor__emoji-trigger:hover, .symbol-flags-editor__emoji-trigger[aria-expanded="true"] { color: var(--text); background: var(--overlay-1); } .symbol-flags-editor__emoji-picker { position: absolute; z-index: var(--z-100); top: calc(100% + var(--space-xs)); left: 0; width: min(22rem, calc(100vw - var(--space-xl) - var(--space-xl))); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; } .symbol-flags-editor__emoji-picker.hidden { display: none !important; } .symbol-flags-editor__emoji-picker-element { display: block; width: 100%; height: 20rem; color-scheme: dark; --background: var(--bg-elevated); --border-color: var(--border); --border-radius: var(--radius-md); --button-active-background: var(--overlay-3); --button-hover-background: var(--overlay-2); --category-font-color: var(--text); --category-font-size: var(--font-sm); --emoji-padding: var(--space-xs); --emoji-size: var(--font-xxl); --indicator-color: var(--info); --input-border-color: var(--border); --input-border-radius: var(--radius-sm); --input-font-color: var(--text); --input-font-size: var(--font-sm); --input-placeholder-color: var(--text-muted); --outline-color: var(--border-focus); --skintone-border-radius: var(--radius-round); } .symbol-flags-editor__match { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); border: none; margin: 0; padding: 0; } .symbol-flags-editor__radio { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--font-sm); color: var(--text); } .symbol-flags-editor__hint, .symbol-flags-editor__suffix, .symbol-flags-editor__sep { font-size: var(--font-xs); color: var(--text-muted); } .symbol-flags-editor__rules { display: flex; flex-direction: column; gap: var(--space-sm); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-sm); } .symbol-flags-editor__rule { display: flex; flex-direction: column; gap: var(--space-xs); } .symbol-flags-editor__rule:not(:last-child) { border-bottom: 1px dashed var(--border); padding-bottom: var(--space-sm); } .symbol-flags-editor__rule-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); } .symbol-flags-editor__rule-field { flex: 1; min-width: 8em; } .symbol-flags-editor__rule-remove { margin-left: auto; width: 1.5em; height: 1.5em; padding: 0; font-size: var(--font-sm); } .symbol-flags-editor__value, .symbol-flags-editor__value-wrap, .symbol-flags-editor__source-param { display: flex; align-items: center; gap: var(--space-xs); } .symbol-flags-editor__value-input { width: 7em; } .symbol-flags-editor__value-input--list { width: 12em; } .symbol-flags-editor__days-input { width: 3.5em; text-align: center; } .symbol-flags-editor__rule-extra { display: flex; flex-wrap: wrap; gap: var(--space-xs); } .symbol-flags-editor__rule-extra:empty, .symbol-flags-editor__chips:empty, .symbol-flags-editor__preview-status:empty, .symbol-flags-editor__preview-rows:empty, .symbol-flags-editor__error:empty { display: none; } .symbol-flags-editor__rule-actions { display: flex; gap: var(--space-sm); } .symbol-flags-editor__template-input { font-size: var(--font-md); font-family: var(--font-sans); padding: var(--space-sm); min-height: 2.75em; max-height: 6em; width: 100%; box-sizing: border-box; } .symbol-flags-editor__chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); } .symbol-flags-editor__chip { padding: var(--space-xs) var(--space-sm); font-size: var(--font-xs); line-height: 1; color: var(--text-muted); background: none; border: 1px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition-fast); } .symbol-flags-editor__chip:hover { background: var(--overlay-2); color: var(--text); } .symbol-flags-editor__chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-bg); } .symbol-flags-editor__chip--placeholder { font-family: var(--font-mono); } .symbol-flags-editor__error { margin: 0; font-size: var(--font-xs); color: var(--danger); } .symbol-flags-editor__rule-error { padding-left: var(--space-sm); } .symbol-flags-editor__preview-head { font-size: var(--font-sm); font-weight: 600; color: var(--text-muted); } .symbol-flags-editor__preview-status { display: flex; flex-direction: column; gap: var(--space-xs); } .symbol-flags-editor__preview-status-line { font-size: var(--font-xs); color: var(--text-muted); } .symbol-flags-editor__preview-status-line--error { color: var(--danger); } .symbol-flags-editor__preview-rows { display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--font-xs); color: var(--text-muted); } .symbol-flags-editor__preview-row { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; } .symbol-flags-editor__preview-emoji { width: 1.5em; text-align: center; flex-shrink: 0; } .symbol-flags-editor__preview-body { display: flex; align-items: baseline; gap: var(--space-sm); flex: 1; min-width: 0; } .symbol-flags-editor__preview-symbol { font-weight: 600; color: var(--text); flex-shrink: 0; } .symbol-flags-editor__preview-tip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .symbol-flags-editor__foot { display: flex; align-items: flex-start; gap: var(--space-sm); margin-top: var(--space-xs); } .symbol-flags-editor__form-error { flex: 1; } .symbol-flags-editor__actions { display: flex; gap: var(--space-sm); margin-left: auto; } .symbol-flags-editor__discard { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; } .symbol-flags-editor__discard-text { font-size: var(--font-sm); color: var(--text-muted); } @keyframes symbol-flags-row-flash { from { background-color: color-mix(in srgb, var(--accent) 22%, transparent); } to { background-color: transparent; } } .symbol-flags-row--highlighted { animation: symbol-flags-row-flash 1.8s ease 1; border-radius: var(--radius-sm); } /* Analyze Modal Styles — width comes from .modal-content--lg. */ .analyze-modal-content { max-width: 95vw; max-height: 85vh; max-height: 85dvh; padding: 0; display: flex; flex-direction: column; } .analyze-modal-body { flex: 1; min-height: 0; overflow-y: auto; } /* Settings Modal — Data Sync panel in a dialog (gear icon in nav). It fits the default sm width, so it names no size. */ .settings-modal-content { max-width: 95vw; max-height: 85vh; max-height: 85dvh; display: flex; flex-direction: column; } .settings-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); } .settings-modal-body { flex: 1; min-height: 0; overflow-y: auto; } /* Sidebar sections in Settings: one row per section, a toggle and two movers. */ .nav-layout-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-xs); } .nav-layout-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); } .nav-layout-row__toggle { display: flex; align-items: center; gap: var(--space-sm); cursor: pointer; } .nav-layout-row__toggle input:disabled + span { color: var(--text-muted); } .nav-layout-row__move { display: flex; gap: var(--space-xs); } .nav-layout-row__move button { min-width: var(--control-height); min-height: var(--control-height); border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; } .nav-layout-row__move button:disabled { opacity: 0.4; cursor: default; } .settings-sync-status { display: flex; gap: var(--space-md); flex-wrap: wrap; } /* Notifications — same scroll shape as Settings, with a filing table and the global bankruptcy banner the poller raises. */ .notifications-modal-content { max-width: 95vw; max-height: 85vh; max-height: 85dvh; display: flex; flex-direction: column; } .notifications-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs) var(--space-sm); font-size: var(--font-xs); } .notifications-status__text { color: var(--text-muted); } /* The unread count reads as a state, not as a second sentence in the status line, so it cannot be lost inside the `·` join the old line used. */ .notifications-status__unread { padding: 0 var(--space-xs); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text-primary); font-weight: 600; } .notifications-status__unread--quiet { background: transparent; color: var(--text-muted); font-weight: 400; } .notifications-error { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--negative-bg); border: 1px solid var(--negative); border-radius: var(--radius-md); color: var(--negative-text); font-size: var(--font-sm); } /* `.notifications-error` sets `display: flex`, which outranks the UA's `[hidden] { display: none }`; the hidden state has to be restated. */ .notifications-error[hidden] { display: none; } .notifications-error__text { flex: 1; min-width: 0; } .notifications-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-md); } .notifications-filters { justify-content: flex-end; } .notifications-prefs { flex-direction: column; align-items: stretch; width: 100%; } .notifications-prefs__group { width: 100%; } .notifications-table { width: 100%; table-layout: fixed; } .notifications-table .notification-cell--kind { width: 16%; } .notifications-table .notification-cell--symbol { width: 11%; } .notifications-table .notification-cell--date { width: 15%; } .notifications-table .notification-cell--actions { width: 14%; } .notification-row--unread { background: color-mix(in srgb, var(--accent) 6%, transparent); } .notification-row__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .notification-row__meta { color: var(--text-muted); font-size: var(--font-xs); } .notification-row__read { font-size: var(--font-xs); white-space: nowrap; } /* Below the tablet width the four-column table does not fit a dialog capped at 95vw: the rows become stacked blocks instead of a horizontal scroller inside the modal. Explicit roles keep the table semantics across the display change. */ @media (width <= 768px) { .notifications-table, .notifications-table tbody { display: block; } .notifications-table thead { display: none; } .notifications-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kind actions" "filing filing" "symbol date"; gap: var(--space-xs) var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); } .notifications-table tr:last-child { border-bottom: 0; } .notifications-table td { display: block; width: auto; padding: 0; border: 0; } .notification-cell--kind { grid-area: kind; } .notification-cell--filing { grid-area: filing; } .notification-cell--symbol { grid-area: symbol; align-self: center; } .notification-cell--date { grid-area: date; text-align: right; } .notification-cell--actions { grid-area: actions; justify-self: end; } .notifications-filters { justify-content: flex-start; } } .notification-banner { position: fixed; top: var(--space-lg); right: var(--space-lg); z-index: var(--z-500); display: flex; align-items: center; gap: var(--space-sm); max-width: 90vw; padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--danger); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); } .notification-banner__text { flex: 1; font-size: var(--font-sm); color: var(--text-primary); } @media (width <= 480px) { .notification-banner { inset: auto var(--space-md) var(--space-md); max-width: none; } } /* Geometry comes from .modal-input--sm; what is left here is what makes it an Analyze field — a symbol, so uppercase and tracked. The old radius-sm was the only radius in the tree outside the scale's --radius-md. */ .analyze-modal-input { flex: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; } .analyze-modal-input:focus { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-color: var(--accent); } .analyze-input-group { display: flex; gap: var(--space-xs); flex: 1; } .analyze-search-btn { padding: var(--space-xs-plus) var(--space-sm-plus); font-size: var(--font-sm); font-weight: 700; background: var(--accent); color: var(--bg); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); } .analyze-search-btn:hover { filter: brightness(1.2); } .analyze-search-btn:active { transform: scale(0.95); } @media (width <= 768px) { .analyze-modal-content { width: 100%; max-height: var(--viewport-h); border-radius: var(--radius-md); } } .modal-title { font-size: var(--font-xl); font-weight: 600; margin-bottom: var(--space-md); } .flex { display: flex; } .text-dim { color: var(--text-muted); } .hidden { display: none !important; } /* ── Utility classes ── */ .u-flex-1 { flex: 1; } .u-ml-auto { margin-left: auto; } .u-text-dim { font-size: var(--font-sm); color: var(--text-dim); font-weight: 600; } .u-text-xs { font-size: var(--font-xs); color: var(--text-muted); } .u-mb-xs { margin-bottom: var(--space-xs); } .u-mb-sm { margin-bottom: var(--space-sm); } .u-mb-md { margin-bottom: var(--space-md); } .u-mt-md { margin-top: var(--space-md); } .u-mt-xl { margin-top: 2rem; } .u-ml-sm { margin-left: var(--space-sm); } .u-pl-lg { padding-left: var(--space-lg); } .u-min-w-0 { min-width: 0; } .u-min-line { min-height: 1.5em; } .u-m-0 { margin: 0; } .u-cursor-pointer { cursor: pointer; } .u-w-full { width: 100%; } /* Initial state for elements JS reveals with `el.style.display = …`. Not the `.hidden` class: that one is !important and would win over the reveal. */ .u-hidden { display: none; } .u-mono { font-family: var(--font-mono); } .u-text-sm { font-size: var(--font-sm); color: var(--text-secondary); } .u-stack { display: flex; flex-direction: column; gap: var(--space-sm); } .u-row { display: flex; align-items: center; gap: var(--space-sm); } .u-progress-track { height: var(--space-sm); background: var(--bg); border-radius: var(--radius-md); overflow: hidden; } .u-progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width var(--transition-slow); } /* ── Symbol / Stock Link ── */ .symbol-link { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; } /* The surfaces that style the symbol under their own class (chart legend, chart symbol search, the calendar rows, the inspector header, the level2 quote bar, the alert panel) now render a real anchor too, via shared/symbol-link.ts's `symbolActionHtml`. They keep their own class and their own colours; what they share is this reset, so none of them picks up a user-agent underline the moment it stops being a span. A global rule rather than six, because "every symbol is a link" is one rule. */ :is( .chart-legend-symbol, .chart-dropdown-symbol, .cal-stock-symbol, .inspector-symbol, .l2-quote-symbol-name, .chart-alert-symbol, .dilution-symbol ) { text-decoration: none; } /* ── Responsive Breakpoints System ── */ /* BREAKPOINTS UNIFICADOS (usar estos en TODOS los archivos CSS): xs: <480px → phones chicos (iPhone SE) sm: <768px → tablets / phones grandes md: <1024px → tablets landscape / laptops chicos lg: <1400px → desktop Base (>1400px): desktop grande Regla: siempre reducir columnas / apilar antes de recortar padding. */ /* ── Sidebar Responsive ── The sidebar is fixed and full-height on all sizes. On ≤768px it becomes a slide-in drawer (hidden by default) to preserve content width on small screens; a `nav--open` class (plus overlay) reveals it. */ @media (width <= 768px) { body { padding-left: 0; } /* Lock background scroll while the drawer is open */ body.nav--open { overflow: hidden; } /* Hide the floating hamburger while the drawer is open (closing happens via overlay click, Escape, or a nav action) */ body.nav--open #nav-toggle-float { display: none; } nav.main-nav { transform: translateX(-100%); width: 200px; box-shadow: var(--shadow-lg); transition: transform var(--transition-base); } body.nav--open nav.main-nav, nav.main-nav.nav--open { transform: translateX(0); } /* Drawer rows are touch targets: at least the 44px minimum tall. */ nav.main-nav .nav-search-btn, nav.main-nav .nav-links a { min-height: var(--touch-min); } /* The drawer's own toggle is off-screen while closed; use the floating hamburger (rendered as a body sibling) instead. */ nav.main-nav .nav-toggle { display: none; } /* The float is 38px tall and sits 8px from the top-left corner, so every page needs a real offset for its first content child or the hamburger covers the page title / topbar. The chart page has no .page-wrapper — chart.css offsets .chart-shell instead. The bottom padding keeps the last row of a page clear of the iPhone home indicator (pages opt into the notch via viewport-fit=cover). */ .page-wrapper { padding-top: calc(var(--nav-float-size) + var(--space-md)); padding-bottom: calc(var(--space-xl) + var(--safe-b)); } /* Full-screen modals: keep the close/send row above the home indicator instead of letting it sit on the physical bottom edge. */ .modal-content, .chat-modal-content, .analyze-modal-content { padding-bottom: calc(var(--space-lg) + var(--safe-b)); } #nav-toggle-float { display: flex; align-items: center; justify-content: center; position: fixed; top: var(--space-sm); left: var(--space-sm); /* Below the modals (--z-1000) so an open modal owns the top-left corner; the drawer's own scrim (--z-200) matches it. */ z-index: var(--z-200); /* Explicit box: the real size is 8 padding + 1 border + 20 svg + 1 border + 8 padding. Stating it means the offset pages reserve above cannot drift 2px short of the button. */ width: var(--nav-float-size); height: var(--nav-float-size); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; padding: var(--space-sm); border-radius: var(--radius-md); transition: all var(--transition-fast); } #nav-toggle-float:hover { color: var(--text); background: var(--border); } #nav-toggle-float svg { width: var(--icon-size); height: var(--icon-size); display: block; } /* Overlay to close the drawer */ body.nav--open::before { content: ""; position: fixed; inset: 0; background: color-mix(in srgb, var(--black) 50%, transparent); z-index: var(--z-200); } /* Drawer always shows the nav labels for easy navigation. Matches the specificity of the collapsed-sidebar hide rule above (body:not(...) .x), because body .nav-label alone lost to it and the drawer showed icons only. */ body:not(.sidebar-expanded) .nav-label, body .nav-label { display: inline; } body .nav-brand-label { display: inline; } } /* ── Grid Breakpoints ── */ @media (width <= 1400px) { .results-grid, .grid-layout { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); } } @media (width <= 1024px) { .results-grid, .grid-layout { grid-template-columns: repeat(auto-fill, minmax(min(var(--split-card-min-mobile), 100%), 1fr)); } /* .action-row stacks a column earlier than the other two row patterns: the buttons inside it are long enough that a row of them wraps into an unreadable two-line mess on a tablet. It lives here, with the class, instead of being re-declared in the page that first needed it. */ .action-row { flex-direction: column; align-items: stretch; } } @media (width <= 480px) { .results-grid, .grid-layout, .dash-grid, .split-grid, .presets-panel { grid-template-columns: 1fr; } .inspector-metrics { grid-template-columns: 1fr 1fr; } /* Touch targets: minimum 44px for buttons on mobile */ .btn, .tf-selector .tf-btn, .view-toggle .view-btn, nav.main-nav a { min-height: var(--touch-min); } /* Icon buttons and dense controls are 18–32px wide on desktop — a thumb can't hit them. 44px min keeps the same visual weight (the icon stays put) while the hit area grows. Only the selectors common.css owns are listed. The chart page's and the playbook page's own controls used to be named here too, which forced this file to track the class inventory of three pages it does not style; each of those now carries its own list in its own <=480px block (chart.css, playbook.css), where the rest of its page overrides already live. */ .chart-topbar__actions .btn, .chart-date-jump-cal-header button, .ac-card-remove, .analyze-tab-close, .symbol-flags-toggle, .cal-nav-btn { min-width: var(--touch-min); min-height: var(--touch-min); } .chart-screener-filters .input-field { min-height: var(--touch-min); } /* Type scale step for small phones. 10–11px text was tuned on a desktop monitor and is unreadable at 6" / DPR 3; every rule in the app goes through these tokens, so this is the whole responsive type system in four lines. The four smallest steps move together, and they have to: this block used to raise only xxs/xs/sm, which pushed --font-sm onto --font-md's value (both 13px) so a --font-sm label next to a --font-md one was indistinguishable. Any subset leaves a collision — raising xxs alone lands it on the base --font-xs, raising xxs+xs lands --font-xs on the base --font-sm — so the step is taken as a unit and --font-md moves with it. The ladder stays strictly increasing and 14px still leaves room below the unmoved --font-lg (15px). */ :root { --font-xxs: 0.6875rem; --font-xs: 0.75rem; --font-sm: 0.8125rem; --font-md: 0.875rem; } /* Uppercase micro-labels: the 0.05–0.1em tracking was tuned on a desktop monitor and, with a bigger glyph in a narrower column, it makes the word harder to read rather than easier. 0.04em is the cap. Scoped to the selectors common.css owns. A page stylesheet's own uppercase rule sits after this file at equal specificity, so listing its selectors here would be dead weight — each page's overrides belong in that page's own <=480px block. */ .input-label, .btn, .view-toggle .view-btn, .metric-label, .badge, .analyze-modal-input, .modal-field-label, .info__label, .chart-alert-status, .alb-preview-head, .fbc-sort-label, .flip-card__notes-label { letter-spacing: 0.04em; } .stock-row { grid-template-columns: 80px 1fr 1fr 1fr; /* hide the less critical columns at the narrowest mobile width */ } body:not([data-page="chart"]) .page-wrapper { padding-top: calc(var(--nav-float-size) + var(--space-sm)); } .cal-day { min-height: var(--touch-min); } } /* The horizontal-scroll wrapper and the trades table's 500px floor used to live here as a shared rule. Both consumers have since taken ownership -- `.trades-sidebar .trades-table-wrap` in trades.css and `.results-table-container` in scan.css -- so these were dead weight in a file that does not style either page. */ /* stock-row: per-page variants — they replace inline styles from JS */ .stock-row--label { /* A 20px leading column, not an icon size: no column token names it, and --icon-size is for glyphs. */ grid-template-columns: 20px 1fr auto; padding: var(--space-sm); background: var(--bg); border: none; } /* The Manage Labels list is a set of named rows, not stock cards: the swatch carries the label's own colour, and the name reads as body text rather than the muted row copy the stock variant uses. */ .stock-row--label strong { color: var(--text); } .label-badge--swatch { width: var(--space-md); height: var(--space-md); padding: 0; } .label-list-hint { color: var(--text-muted); font-size: var(--font-xs); margin-top: var(--space-sm); } /* list-view rows: JS writes only the --row-cols track list, so the stylesheet keeps ownership of the track sizing and can reshape it per breakpoint. Qualified with .stock-row on purpose. The base .stock-row card rule further down this file declares its own six-track grid-template-columns at the SAME specificity, and being later it won: --row-cols was silently discarded, the 7th cell onward fell into implicit grid rows, and one result rendered as up to three stacked sub-rows. Measured on discover (17 columns): 6 tracks resolved instead of 17, 3 template rows, 4 distinct cell top offsets, 85px per record. Source order alone is not a contract — the qualifier makes the list track list win regardless of where the base rule sits. */ .stock-row.stock-row--list, .stock-row.stock-row--list-header { /* 40px is the list-header fallback column, not a control floor: --touch-compact has the same value but names a control. */ grid-template-columns: var(--row-cols, 40px); } /* A list row is a data-table row, not the card the base .stock-row styles. The card spent ~31px of chrome around an 18px line (1px border top and bottom, 6px padding top and bottom, 4px radius), so a results list showed roughly a third of the rows it could and read as stacked cards rather than a table. A hairline separator and 2px padding hand the height back to the line. The base card rule is untouched for its tile usage. line-height is a fixed length, not the inherited ratio, because cells in one row do not share a font size: .metric-value is --font-md against the row's --font-sm, and a ratio line box sized each of them independently (19.5px vs 18px), leaving the numeric columns 1.5px off the symbol column's baseline. One box height for the whole row puts every cell on one baseline. */ .stock-row.stock-row--list { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius-none); padding: var(--space-2xs) var(--space-sm); line-height: 18px; } /* The lead star shares the row's line box. Left at its natural 25px it made the row taller than the header, and since the cells are centred in the row (align-self: center, so a tall neighbour does not drag single-line text) they ended up 4px below the header label for their own column — a vertical misalignment that only appears on pages that render a star. The whole row is the click target; the star is a secondary toggle, so it takes the line. */ .stock-row.stock-row--list > .unified-chart-action-btn { height: 18px; min-width: 18px; padding: 0 var(--space-xs); line-height: 1; } /* The base hover only recolours a border, which on a hairline row means one coloured pixel — give the row a surface so the pointer's row is findable. */ .stock-row.stock-row--list:hover { background: var(--bg-elevated); border-bottom-color: var(--accent); } @media (width <= 480px) { /* 40px lead track plus one flexible track per data column, so a list row fits the viewport instead of overflowing at 670px+. */ .stock-row.stock-row--list, .stock-row.stock-row--list-header { /* 40px is the phone list-header column, not a control floor: --touch-compact has the same value but names a control. */ grid-template-columns: 40px; grid-auto-columns: minmax(0, 1fr); } .stock-row.stock-row--list > *, .stock-row.stock-row--list-header > * { min-width: 0; } /* Dense rows are a pointer layout: 2px of padding and an 18px line box hand the height back to the text. A phone has no pointer, so the row's own link and its secondary star each take the 28px touch floor the responsive audit enforces instead — a taller row is the cost of a hit area a finger can actually land on. */ .stock-row.stock-row--list .symbol-link { display: inline-flex; align-items: center; min-height: var(--control-height); } .stock-row.stock-row--list > .unified-chart-action-btn { height: var(--control-height); min-width: var(--control-height); } } /* The header shares the rows' horizontal padding and column gap, or every label sits a padding-width to the left of the column it titles. Vertical padding stays 0: this is a label row, and giving it the rows' 2px only makes the header taller than the labels need. */ .stock-row.stock-row--list-header { background: transparent; border: none; padding: 0 var(--space-sm); } .list-header { display: grid; gap: var(--space-sm); } /* A headerCell list header (ListView.renderTable) is a table so its th cells parse. The table, thead and tr take no box, so the cells are the row's grid tracks exactly as the span headers were. */ .list-header__table, .list-header__table thead, .list-header__table tr { display: contents; } /* The lead cell is pinned to the first track instead of being placed in source order. A page whose header cells are its own s (discover) hands them to the parser inside the header table's , where HTML5 foster parenting moves them out in front of the table: the lead then became the last grid item, every label sat one track (40px plus the row gap) to the left of the column it titles, and the lead landed in the last column. Pinning the lead to the track the row's --row-cols reserve for it holds whatever order the parser leaves the cells in, and grid auto-placement starts the labels at the second track; a header whose cells already parse in order (the pages) is unaffected. */ .list-header__lead { padding: 0; grid-column: 1; grid-row: 1; } /* Sortable column headers (shared/sortable-table.ts). The th keeps the column's track and label typography; the button fills the label so the whole label is the target. A phone gets the 28px touch floor the responsive audit checks. */ .sortable-th { padding: 0; margin: 0; min-width: 0; text-align: left; font: inherit; font-weight: inherit; color: inherit; white-space: nowrap; } .sortable-th__button { display: inline-flex; align-items: center; gap: var(--space-2xs); max-width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; } .sortable-th__button:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-sm); } .sortable-th--active { color: var(--accent); } .sortable-th__arrow { font-size: 0.7em; line-height: 1; } @media (width <= 480px) { /* --control-height (26px) is under the touch floor, so the header button takes it on both axes. */ .sortable-th__button { min-width: var(--touch-floor); min-height: var(--touch-floor); } } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } /* ── Shared animations (used across pages) ── */ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } @keyframes slideUpFade { from { opacity: 0; /* 20px is this sheet's slide distance; --icon-size shares the value but names a glyph box. */ transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes slideDownFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } } @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } } @keyframes loading-bar-slide { 0% { transform: translateX(-100%); } 50% { transform: translateX(150%); } 100% { transform: translateX(350%); } } @keyframes alert-trigger-flash { 0% { background: var(--positive-bg); } 50% { background: color-mix(in srgb, var(--positive) 30%, transparent); } 100% { background: var(--positive-bg); } } /* Geometry comes from .select-field--sm (see common.css); this rule is the one thing the base cannot know: the selector holds a grid column. */ .unified-chart-label-selector { max-width: 120px; } /* The stock row's selector holds its grid column; the dashboard's flip card keeps the shrink-to-content behaviour the base rule above allows. */ .unified-chart-label-selector--fixed { width: 120px; } .unified-chart-action-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: var(--space-xs) var(--space-sm); font-size: var(--font-sm); font-weight: 600; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); min-width: var(--space-xl); } .unified-chart-action-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } .unified-chart-action-btn.added { background: var(--positive); color: var(--on-accent); border-color: var(--positive); } .unified-chart-action-btn.remove { background: transparent; color: var(--negative); border-color: var(--negative); } .unified-chart-action-btn.remove:hover { background: var(--negative); color: var(--on-danger); } .stock-row { display: grid; grid-template-columns: 90px 90px 90px 90px 100px 70px; gap: var(--space-sm); align-items: center; padding: var(--space-sm); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--font-sm); transition: border-color var(--transition-fast); } .stock-row:hover { border-color: var(--accent); } .stock-row-symbol { font-weight: 600; color: var(--accent); cursor: pointer; } .stock-row-symbol:hover { text-decoration: underline; } .stock-row-price { font-weight: 600; } .stock-row-change { font-weight: 600; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-md); text-align: center; } .stock-row-change.positive { color: var(--positive-text); background: var(--positive-bg); } .stock-row-change.negative { color: var(--negative-text); background: var(--negative-bg); } .stock-row-volume { color: var(--text-muted); font-size: var(--font-sm); } /* ── List header drag-reorder (discover & scanner) ──────────────────── */ .list-header__drag-ghost { position: fixed; pointer-events: none; z-index: var(--z-max); padding: 3px 10px; background: var(--primary); color: var(--bg); border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 600; white-space: nowrap; opacity: 0.92; transform: translate(-50%, -130%); box-shadow: 0 3px 10px var(--scrim-25); } .list-header__drop-indicator { position: fixed; pointer-events: none; z-index: calc(var(--z-max) - 1); width: 3px; background: var(--accent); border-radius: var(--radius-sm); opacity: 0; transition: opacity var(--transition-instant); } .list-header__drop-indicator.active { opacity: 1; } .list-header span.list-header__drag-source { opacity: 0.3; } .label-badge { display: inline-block; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-md); font-size: var(--font-xs); font-weight: 600; color: var(--on-accent); } textarea { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: var(--space-md); border-radius: var(--radius-md); font-family: var(--font-sans); font-size: var(--font-lg); min-height: var(--touch-min); max-height: 150px; resize: vertical; transition: border-color var(--transition-fast); } .empty-state { text-align: center; /* 20px inline padding: the spacing scale has no 20px step (4/8/16/24), and --icon-size, the only equal value, names glyphs. A literal until the scale grows a step; inventing --space-md-plus here would add a ninth size. */ padding: 60px 20px; color: var(--text-muted); background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border); margin: var(--space-lg) 0; } /* ── Filter help button (shared opt-in) ── Promoted out of scan.css: the reports page puts the same "?" beside its filter expression and does not load the scanner's stylesheet, so there the button fell back to the UA default and rendered 179px wide beside the textarea. Any page with a filter box uses this one. */ .btn-help-icon { display: flex; align-items: center; justify-content: center; width: var(--control-height); height: var(--control-height); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text-muted); font-size: var(--font-lg); font-weight: 700; cursor: pointer; flex-shrink: 0; transition: all var(--transition-base); } .btn-help-icon:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); } /* A 28px target is under the 44px touch minimum, so it grows on phones. */ @media (width <= 480px) { .btn-help-icon { width: var(--trades-layout-offset); height: var(--trades-layout-offset); } } input, select, textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); } textarea:focus, input:focus, select:focus { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-color: var(--accent); } button { font-family: var(--font-sans); cursor: pointer; border-radius: var(--radius-md); border: 1px solid transparent; padding: 10px var(--space-md); font-weight: 600; transition: transform 0.1s ease, filter 0.1s ease; background: var(--bg); color: var(--text); } button:active { transform: scale(0.98); } button.secondary { background: var(--secondary); color: var(--text-secondary); border-color: transparent; } button.secondary:hover { background: var(--secondary-hover); color: var(--text); } button.danger { background: var(--danger); color: var(--bg); } button.danger:hover { background: var(--danger-hover); } /* ======================================== Inspector Panel (shared across workspaces) ======================================== */ .inspector-panel { display: flex; flex-direction: column; height: 100%; background: var(--bg-elevated); border-radius: var(--radius-md); overflow: hidden; } .inspector-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md); border-bottom: 1px solid var(--border); flex-shrink: 0; } .inspector-title { display: flex; align-items: baseline; gap: var(--space-sm); } .inspector-symbol { font-weight: 700; font-size: var(--font-xl); color: var(--accent); } .inspector-date { font-size: var(--font-sm); color: var(--text-muted); } .inspector-change { font-size: var(--font-md); font-weight: 700; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-md); } .inspector-change.positive { background: var(--positive-bg); color: var(--positive-text); } .inspector-change.negative { background: var(--negative-bg); color: var(--negative-text); } .inspector-close { color: var(--text-muted); font-size: var(--font-xxl); cursor: pointer; padding: 0 var(--space-xs); line-height: 1; } .inspector-close:hover { color: var(--text); } .inspector-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); padding: 1px; flex-shrink: 0; } .metric { background: var(--bg-elevated); padding: 10px var(--space-sm-plus); display: flex; flex-direction: column; gap: var(--space-xs); } .inspector-actions { display: flex; gap: var(--space-sm); padding: var(--space-md); border-top: 1px solid var(--border); flex-shrink: 0; } .inspector-action-btn { flex: 1; padding: var(--space-sm) var(--space-md); font-size: var(--font-sm); font-weight: 600; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-base); } .inspector-action-btn:hover { border-color: var(--accent); background: var(--bg-elevated); } /* Typography utilities */ .text-negative { color: var(--negative); } /* Width comes from .modal-content (sm). */ .app-dialog { max-width: 95vw; } .app-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); } .app-dialog__header .modal-title { margin-bottom: 0; } .app-dialog__message { white-space: pre-wrap; line-height: 1.5; color: var(--text-muted); margin: var(--space-md) 0 0; } .app-dialog__field { display: block; font-size: var(--font-xs); color: var(--text-muted); margin: var(--space-md) 0 var(--space-xs); } .app-dialog__input { width: 100%; } .app-dialog__actions { margin-top: var(--space-lg); } /* ── Modal form helpers ── */ /* Shared footer row for every dialog that ends in Cancel/Save-style buttons (backtest, scan, watchlist, discover, playbook, dashboard). Pages that need a pinned/bordered variant override this locally. */ .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); } .modal-field-group { margin-bottom: var(--space-md); } .modal-field-label { font-size: var(--font-xs); color: var(--text-muted); margin-bottom: var(--space-xs); text-transform: uppercase; letter-spacing: 0.05em; } .modal-field-row { display: flex; gap: var(--space-md); align-items: center; } .modal-field-row label { font-size: var(--font-sm); color: var(--text-secondary); display: flex; gap: var(--space-xs-plus); align-items: center; } .modal-field-row input[type="number"] { width: 60px; text-align: center; } /* ── Accessibility: Reduced Motion ── The universal rule flattens every CSS animation and transition. The two scrolling bodies are named explicitly as well: they are the containers a reader actually scrolls inside a dialog, and they set scroll-behavior on themselves, so the intent should be visible where it applies rather than only inherited from a blanket selector. Not reachable from here, because CSS cannot reach the script: the one JS-driven piece of motion, the at-risk tab bar's smooth scroll, asks static/js/core/reduced-motion.ts instead (STY-4.8). The app's other requestAnimationFrame uses are layout and focus, not animation, and stay. */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } .chat-modal-body, .filter-help-body { scroll-behavior: auto; } /* A stopped spinner must still read as "busy": keep the accent arc static instead of letting it freeze mid-rotation. */ .spinner { animation: none; } } /* ── Loading spinner ────────────────────────────── One base ring for every `.spinner` in the app. The only place this used to be sized was `.chat-modal-tool-call .spinner` (a 10px ring in a tool-call row), so a bare `
` — the Analyze modal's loading state and the Chat modal awaiting its first response — rendered as a 0x0 div and the panel stayed empty. `.chat-modal-tool-call .spinner` keeps its own size override; everything else inherits this one. The spin duration is a literal on purpose: it is an animation period, not a UI transition, so it must not read the --transition-* tokens. */ .spinner { width: var(--spinner-size); height: var(--spinner-size); border: var(--space-2xs) solid var(--border); border-top-color: var(--accent); border-radius: var(--radius-round); animation: spinner-spin 0.8s linear infinite; flex-shrink: 0; } @keyframes spinner-spin { to { transform: rotate(360deg); } } /* ── Loading bar (YouTube-style) ────────────────── */ .loading-bar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: var(--z-max); pointer-events: none; visibility: hidden; } .loading-bar::after { content: ""; display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--accent), var(--info), var(--accent)); background-size: 200% 100%; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; animation: loading-bar-slide 1.4s ease-in-out infinite; transform: translateX(-100%); } /* ── Loading states responsive ──────────────────── */ @media (width <= 768px) { .state { padding: var(--space-lg) var(--space-md); margin: var(--space-sm); font-size: var(--font-sm); } .status-loading, .status-empty, .status-error { padding: var(--space-lg) var(--space-md); margin: var(--space-sm); font-size: var(--font-sm); } } /* ═══════════════════════════════════════════════════════════════════════ Shared patterns — opt-in classes promoted from reverse-splits page. Pages use these by adding the class; nothing changes unless a page explicitly opts in. ═══════════════════════════════════════════════════════════════════════ */ /* Shared page header — the same title/context/count/next-action block every discovery source renders (see features/shared/page-header.ts). No subtitle line: the title and its meta row are the whole header. */ .page-header { margin: 0 0 var(--space-md); padding-bottom: var(--space-xs); border-bottom: 1px solid var(--border); } .page-header__title { font-family: var(--font-heading); font-weight: 700; font-size: var(--page-title-size); color: var(--text); margin: 0; } .page-header__meta { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); font-size: var(--font-sm); color: var(--text-muted); } .page-header__context::before { content: "context · "; color: var(--text-dim); } .page-header__count::before { content: "results · "; color: var(--text-dim); } .page-header__count { color: var(--text); font-weight: 600; } /* Dynamic slots are always rendered but hidden while empty so their "context ·"/"results ·" labels only appear once a value arrives. */ .page-header__context:empty, .page-header__count:empty { display: none; } .page-header__next::before { content: "next · "; color: var(--text-dim); } /* Empty-state placeholder — the view title + instructions centered in the middle of the view, shown while the view is loading/empty/failed. Replaces the old always-on top page header: once data arrives the full height belongs to the results, and the title lives on in the navbar. */ .page-empty { max-width: 620px; margin: var(--space-xxl) auto; padding: 0 var(--space-md); text-align: center; } .page-empty .page-header { border-bottom: none; margin-bottom: var(--space-md); } .page-empty .page-header__meta { justify-content: center; } .page-empty .state--empty { margin-top: var(--space-md); } /* ═══════════════════════════════════════════════════════════════════════ Shared Components (opt-in, promoted from page CSS) ══════════════════════════════════════════════════════════════════════ */ /* ── Calendar Navigation ── */ .cal-nav-btn { background: var(--bg); border: 1px solid var(--border); color: var(--text); width: var(--space-xl); height: var(--space-xl); display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); cursor: pointer; font-size: var(--font-xs); padding: 0; transition: border-color var(--transition-fast); } .cal-nav-btn:hover { border-color: var(--accent); } /* ── Preset list row: name + Load/Delete text buttons (Scan's "Manage Presets" modal, reused by the backtest alert-config manager) ── */ .preset-info { flex: 1; min-width: 0; } .preset-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; } /* ── Preset Item (used by Discover, Scanner) ── */ .preset-item { display: flex; align-items: center; gap: var(--space-sm); padding: 5px var(--space-sm); border-radius: var(--radius-sm); font-size: var(--font-xs); color: var(--text-secondary); cursor: pointer; transition: background var(--transition-base); } .preset-item:hover { background: var(--surface-raised); color: var(--text); } .preset-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .preset-item__actions { display: flex; gap: var(--space-2xs); flex-shrink: 0; } .preset-item__actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: var(--space-2xs) 5px; font-size: var(--font-xs); border-radius: var(--radius-sm); transition: all var(--transition-base); line-height: 1; } .preset-item__actions button:hover { color: var(--text); background: var(--surface); } .preset-item__actions .preset-action-danger:hover { color: var(--danger); } .preset-item__badge { font-size: var(--font-xs); color: var(--text-muted); padding: 1px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); flex-shrink: 0; } /* ── Calendar Day (shared base: Trades + Scanner) ── Page CSS may only override dimensions (min-height, padding) — never re-declare the whole component: duplicate owners make layout depend on order. Trades sets 54px (trades.css); Scanner sets 80px (scan.css). */ .cal-day { background: var(--bg-elevated); min-height: 64px; padding: 5px var(--space-xs-plus); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2xs); cursor: pointer; transition: background var(--transition-fast); position: relative; color: var(--text); } .cal-day:hover { background: var(--overlay-2); } .cal-day--today { background: var(--overlay-1); } .cal-day--selected { box-shadow: inset 0 0 0 1px var(--accent); background: var(--overlay-3); } .cal-day--empty { background: var(--bg); cursor: default; min-height: 64px; } .cal-day--other-month { opacity: 0.3; } /* P&L shown via cell background (not colored text) for legibility. Combined today/selected states brighten the tint with an inset box-shadow layer — the old `background: var(--overlay), var(--tint)` shorthand was invalid (colors don't stack in comma layers) and the browser dropped the declaration. */ .cal-day.pos { background: var(--positive-bg); } .cal-day.neg { background: var(--negative-bg); } .cal-day.pos.cal-day--today, .cal-day.neg.cal-day--today { box-shadow: inset 0 0 0 999px var(--overlay-2); } .cal-day.pos.cal-day--selected, .cal-day.neg.cal-day--selected { box-shadow: inset 0 0 0 999px var(--overlay-3), inset 0 0 0 1px var(--accent); } .day-num { font-family: var(--font-sans); font-size: var(--font-sm); font-weight: 700; color: var(--text-muted); line-height: 1; } .cal-day--today .day-num { color: var(--accent); } /* day-pnl / day-stats / day-trades / day-wins / day-losses / day-wr are trades-calendar-only styles and live in trades.css (single owner). */ /* Origin label — tags a result with the source it came from */ .origin-badge { display: inline-block; font-size: var(--font-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px var(--space-xs); margin-left: var(--space-xs); vertical-align: middle; white-space: nowrap; } /* ── Print Styles ── */ /* ── Print ───────────────────────────────────────── Paper is light. The old block set `body` only, so the ~130 components that set their own `background: var(--bg-elevated)` printed black text on a #1e222d card; `button { display: none }` emptied any cell whose only content was a control; and --text-muted / --positive / --negative kept their dark-theme values, printing dark-theme contrast onto white. Fixing that one component at a time would mean 130 edits, so the print tier re-points the tokens instead: everything already reading var(--bg-elevated) or var(--text-muted) follows for free. The selector is `html body[data-page]`, not `:root`, and deliberately so. The Research and Dilution pages re-declare the same token names on body[data-page="..."] (specificity 0-1-1); a `:root` block (0-1-0) would lose to them and those two pages would still print dark. 0-1-2 outranks both, and because every page carries data-page it also outranks the inherited :root values without a second rule. Not covered: the chart cards' shadow root, which inherits from its host and not from body (see chart-card-element.ts). */ @media print { /* stylelint-disable color-no-hex, lt/no-raw-hex-outside-root -- this IS a token definition block: the print tier of the palette, the same role :root has on screen */ html body[data-page] { --bg: #fff; --bg-primary: #fff; --bg-elevated: #fff; --bg-surface: #fff; --bg-input: #fff; --surface: #fff; --surface-raised: #f7f7f7; --bg-secondary: #f4f4f4; --bg-tertiary: #e8e8e8; --glass-bg: #fff; --glass-border: #b8b8b8; /* Overlays: white washes are invisible on paper, so the same four steps in black keep zebra rows and hovers from vanishing. */ --overlay-1: var(--shade-4); --overlay-2: var(--shade-7); --overlay-3: var(--shade-10); --overlay-4: var(--shade-14); /* Borders */ --border: #a8a8a8; --border-focus: #444; /* Text: every step re-picked for >= 4.5:1 on white. */ --text: #000; --text-primary: #000; --text-secondary: #1c1c1c; --text-muted: #3d3d3d; --text-dim: #4a4a4a; --text-disabled: #6f6f6f; /* --accent carries 22 text-emphasis uses and 13 solid fills, so the print tier inverts the pair: dark ink for the former, and --on-accent flips with it for the latter. */ --accent: #3a3a3a; --on-accent: #fff; --primary: #3a3a3a; --primary-hover: #1c1c1c; --secondary: #4a4a4a; --secondary-hover: #2a2a2a; /* Status colours re-picked for >= 4.5:1 on white, and the tints stay tinted: the P&L sign is carried by the tint, so flattening the tints to white would delete the only channel for the sign (see the forced-colors block above for the same reasoning). */ --positive: #0a6a52; --success: #0a6a52; --positive-bg: var(--positive-10); --negative: #a11d2c; --danger: #a11d2c; --negative-bg: var(--negative-10); --warning: #7a5c00; --warning-text: #7a5c00; --warning-bg: var(--warning-10); --info: #1b4fbd; --info-bg: var(--info-10); --accent-bg: transparent; --catalyst: #7a5c00; /* The app's --on-danger ink is dark and this tier's --danger is dark too: #131722 on #a11d2c is 2.32:1 where white is 7.70:1. */ --on-danger: #fff; /* A drop shadow is a screen affordance; on paper it is a smudge that costs ink. */ --shadow-sm: none; --shadow-md: none; --shadow-lg: none; /* Safe-area insets and the full-viewport height describe a device that has neither on paper. */ --safe-b: 0px; --viewport-h: auto; /* Any control that survives the rules below renders for paper. */ color-scheme: light; } /* stylelint-enable color-no-hex, lt/no-raw-hex-outside-root */ /* Backgrounds are stripped by default when printing; the tints above are the only channel carrying the P&L sign, so ask for them back. */ body, html body[data-page] * { print-color-adjust: exact; -webkit-print-color-adjust: exact; } /* Chrome: navigation exists to navigate a screen. */ nav.main-nav, #nav-toggle-float, .sidebar-toggle-wrap, body.nav--open::before { display: none !important; } /* The sidebar is gone, so its content offset is just a blank margin. */ body { padding-left: 0; } /* Form controls hold no content of their own. */ input, select, textarea, .unified-chart-action-btn { display: none !important; } /* Buttons DO hold content, and a cell whose only child is one prints empty if buttons are hidden — so they are unwrapped into plain text instead of removed. The selector carries a class on purpose: a bare `button` (0-0-1) loses to every button variant (.btn, .btn-primary, .modal-close-btn, ...), so the box would survive the unwrap. */ html body[data-page] button { display: inline; background: none; border: 0; padding: 0; color: inherit; font: inherit; font-size: inherit; box-shadow: none; text-transform: none; letter-spacing: normal; } /* A printed URL is noise and a row of underlines is unreadable. */ a { color: inherit; text-decoration: none; } /* Rows break cleanly across pages; the header repeats on each. */ tr { break-inside: avoid; } thead { display: table-header-group; } } /* ═══════════════════════════════════════════════════════════════════════ Generic chart fullscreen button (matches expand-btn) Used by charts that are NOT wrapped in the element (trades summary charts, scanner backtest/stats). ═══════════════════════════════════════════════════════════════════════ */ .chart-fs-btn { position: absolute; top: var(--space-xs); right: var(--space-xs); z-index: var(--z-10); background: var(--ink-scrim-70); border: 1px solid var(--border); color: var(--text-muted); padding: var(--space-2xs) var(--space-xs-plus); font-size: var(--font-xs); line-height: 1; border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s; } .chart-fs-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } @media (width <= 480px) { /* The overlay button sits on the chart's top-right corner. Its 26px control height is below the 28px touch floor the responsive audit enforces, so it stays a small glyph with a real target of the floor around it. */ .chart-fs-btn { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch-floor); min-height: var(--touch-floor); } /* The TradingView attribution link (35x19) that lightweight-charts paints on every chart. The logo keeps its size; the link box grows around it. */ #tv-attr-logo { display: inline-flex; align-items: center; min-height: var(--touch-floor); } } .chart-fs-overlay { position: fixed; inset: 0; z-index: var(--z-1000); background: var(--bg); display: none; padding: var(--space-md); } .chart-fs-overlay.active { display: block; } .chart-fs-overlay > div { width: 100%; height: 100%; } /* ════════════════════════════════════════════════════════ Analyze Modal (shared) — migrated from analyze.css The analyze modal is a global component (common-runtime.js injects it on every page), so its styles live in common.css. This block is appended at the END of the file to preserve the exact cascade position analyze.css had when injected last — do not move it earlier. ════════════════════════════════════════════════════════ */ /* ── FINAL BOSS KILL SWITCH ── */ #analyze-modal a, #analyze-modal a:link, #analyze-modal a:visited, #analyze-modal a:hover, #analyze-modal a:active { color: var(--text); text-decoration: none; } /* Stock Analyzer */ .analyze-modal-header { padding: var(--space-xs) var(--space-sm); background: var(--bg-elevated); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-xs); } .analyze-clear-header-btn, .analyze-watchlist-btn, .modal-close-btn { background: none; border: none; font-size: var(--font-md); color: var(--text-muted); cursor: pointer; width: var(--space-lg); height: var(--space-lg); display: flex; align-items: center; justify-content: center; transition: color var(--transition-fast); } .analyze-clear-header-btn:hover, .modal-close-btn:hover { color: var(--text-primary); } .analyze-watchlist-btn { font-size: var(--font-lg); color: var(--text-muted); } .analyze-watchlist-btn:hover { color: var(--accent); } .analyze-watchlist-btn.added { color: var(--accent); } .analyze-research-btn { display: flex; align-items: center; justify-content: center; padding: 0 var(--space-sm); height: var(--space-lg); border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; font-size: var(--font-xs); color: var(--text-muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: color var(--transition-fast), border-color var(--transition-fast); } .analyze-research-btn:hover { color: var(--accent); border-color: var(--accent); } .analyze-modal-tabs { background: var(--bg-elevated); padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--border); display: flex; gap: var(--space-xs); overflow-x: auto; flex-wrap: nowrap; /* Hide scrollbar for Chrome/Safari/Firefox */ scrollbar-width: none; } .analyze-modal-tabs::-webkit-scrollbar { display: none; } .analyze-tab { padding: 5px 10px; font-weight: 700; font-size: var(--font-sm); color: var(--text-secondary); cursor: pointer; border: 1px solid transparent; border-radius: var(--radius-sm); transition: all var(--transition-fast); display: flex; align-items: center; gap: var(--space-xs); flex-shrink: 0; } .analyze-tab:hover { background: var(--bg-elevated); color: var(--text-secondary); } .analyze-tab.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); } /* Tab glow — gold border highlight on symbols with a matched news catalyst. */ .analyze-tab--catalyst:not(.active) { border-color: var(--catalyst); background: var(--catalyst-bg); box-shadow: 0 0 var(--space-sm) rgb(var(--catalyst-rgb) / 55%); } .analyze-tab--catalyst.active { box-shadow: 0 0 10px rgb(var(--catalyst-rgb) / 45%); } .analyze-symbol-content { display: none; padding: var(--space-sm); } .analyze-symbol-content.active { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-sm); } /* Firm visual grouping: separate the price-action/event/catalyst data zone from the charts so the hierarchy reads at a glance on any screen width. */ .analyze-symbol-content .analyze-chart-section { border-top: 1px solid var(--border); margin-top: var(--space-xs); padding-top: var(--space-sm); } /* Events and catalyst/news each sit on their own subtle separator so a screen reader / scanner sees clear blocks instead of one dense stream. */ .analyze-symbol-content .analyze-compact-bar ~ .analyze-compact-bar { margin-top: var(--space-2xs); } .analyze-symbol-content .analyze-alert-chips { margin-top: -2px; } /* Chart Section */ .analyze-chart-section { margin: 0; } /* ── Compact Info Bar ── */ .analyze-compact-bar { display: flex; align-items: center; gap: var(--space-xs-plus); font-size: var(--font-sm); color: var(--text-secondary); padding: 0; flex-wrap: nowrap; line-height: 1.4; white-space: nowrap; } .analyze-compact-bar strong { font-weight: 700; color: var(--text-primary); } .analyze-compact-bar .compact-text { color: var(--text-primary); font-weight: 600; flex: 1; min-width: 0; line-height: 1.5; white-space: normal; } .analyze-compact-bar .compact-muted { color: var(--text-muted); flex-shrink: 0; } .analyze-compact-bar .bar-sep { color: var(--border); flex-shrink: 0; margin: 0 3px; } .analyze-compact-bar .compact-dot-positive, .analyze-compact-bar .compact-dot-negative, .analyze-compact-bar .compact-dot-neutral { font-size: var(--font-md); line-height: 1; } .analyze-compact-bar .compact-dot-positive { color: var(--positive); } .analyze-compact-bar .compact-dot-warning { color: var(--warning); } .analyze-compact-bar .compact-dot-negative { color: var(--negative); } .analyze-compact-bar .compact-dot-neutral { color: var(--text-muted); } .analyze-compact-bar .compact-news-link { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--text-primary); text-decoration: none; overflow: hidden; flex: 1; min-width: 0; } .analyze-compact-bar .compact-news-link:hover { color: var(--accent); } .ai-summarize-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 1px 5px; border-radius: var(--radius-md); cursor: pointer; font-size: var(--font-xs); line-height: 1; flex-shrink: 0; transition: all 0.15s; } .ai-summarize-btn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--text-muted); } /* ── JS Floating Tooltip (avoids clipping from overflow: hidden) ── */ .instant-tooltip { position: relative; cursor: help; } .floating-tooltip { /* Surface from .surface (this file); the rule owns the tooltip's own box. */ position: fixed; white-space: pre-line; color: var(--text-primary); padding: var(--space-xs-plus) 10px; font-size: var(--font-xs); font-weight: 600; line-height: 1.5; box-shadow: 0 var(--space-xs) var(--space-sm-plus) color-mix(in srgb, var(--black) 30%, transparent); pointer-events: none; z-index: calc(var(--z-1000) + 1); /* 360px tooltip cap: --chart-min-width has the same value but names a chart, so it is not reused here. */ max-width: min(360px, 90vw); text-align: left; } .floating-tooltip.hidden { display: none; } /* Company Sector — always know what ticker you're on */ .analyze-company-sector { font-size: var(--font-md); font-weight: 600; color: var(--text-secondary); letter-spacing: normal; display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs-plus); line-height: 1.4; } .analyze-company-sector .sector-divider { color: var(--border); margin: 0 var(--space-xs); font-weight: 400; font-size: var(--font-xs); } .sector-item { color: var(--text-secondary); font-weight: 600; } .company-name { color: var(--text-primary); font-weight: 700; } .analyze-alert-chips .sector-divider { color: var(--border); margin: 0 1px; } /* ── Signals row — plain container, no group-level color/label. ── */ .risk-bar { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; font-size: var(--font-xs); color: var(--text-secondary); line-height: 1.4; } .risk-bar-signals { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); min-width: 0; } /* ═══════════════════════════════════════════════════════════════════════ Indicator chip — the ONE shape/size/style for every badge in the analyze modal (dilution/NC/unlock/lockup/earnings/corp-actions/shelf/ATM/theme/ resistance/former-name). Severity is conveyed only by border+text color via the modifier below — same padding, radius, font everywhere. ═══════════════════════════════════════════════════════════════════════ */ .indicator-chip { display: inline-flex; align-items: center; gap: var(--space-xs); padding: 1px 7px; border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid var(--border); background: var(--accent-bg); color: var(--text-muted); } .indicator-chip.instant-tooltip { cursor: help; } .indicator-chip:hover { color: var(--text-primary); border-color: var(--text-muted); } .indicator-chip--critical { border-color: var(--danger); background: var(--negative-bg); color: var(--danger); } .indicator-chip--critical:hover { border-color: var(--danger); } .indicator-chip--warn { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); } .indicator-chip--warn:hover { border-color: var(--warning); } /* News-catalyst chip — gold accent for a recent headline that matched one of the 8 trader catalyst categories (M&A, gov contracts, clinical, ...). */ .indicator-chip--catalyst { border-color: var(--catalyst); background: var(--catalyst-bg); color: var(--catalyst); } .indicator-chip--catalyst:hover { border-color: var(--catalyst); } /* ── events-recent pulse still applies on top of any severity ── */ /* ── Metrics Line (key data in compact row, unified with compact-bar) ── */ .analyze-metrics-line { display: flex; align-items: center; gap: var(--space-xs-plus); font-size: var(--font-sm); color: var(--text-secondary); padding: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; line-height: 1.4; } .analyze-metrics-line strong { font-weight: 700; color: var(--text-primary); } .analyze-metrics-line .bar-sep { color: var(--border); flex-shrink: 0; margin: 0 3px; } .metric-price strong { font-size: var(--font-lg); font-weight: 700; color: var(--text-primary); } .analyze-skeleton { background: linear-gradient( 90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75% ); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); } .analyze-error { background: color-mix(in srgb, var(--negative) 10%, transparent); border: 1px solid var(--negative); border-radius: var(--radius-md); padding: 10px; margin-bottom: var(--space-sm-plus); color: var(--negative); } /* Empty State - Compact */ .analyze-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-md); text-align: center; min-height: 150px; } .analyze-empty-icon { font-size: var(--font-xxxl); margin-bottom: var(--space-sm); } .analyze-empty-title { font-size: var(--font-md); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-xs); } .analyze-empty-text { color: var(--text-muted); font-size: var(--font-sm); } /* Footer with shortcuts hint - Compact */ .analyze-modal-footer { padding: var(--space-xs) var(--space-sm); background: var(--bg); border-top: 1px solid var(--border); font-size: var(--font-sm); color: var(--text-muted); } .analyze-shortcuts-hint { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; } .analyze-shortcut-link { display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: var(--font-sm); cursor: pointer; transition: color var(--transition-fast); } .analyze-shortcut-link:hover { color: var(--accent); } /* `.analyze-shortcut` is only the gap between a key chip and its label now. */ .analyze-shortcut { margin-right: 5px; } /* Keyboard key chip: the one shape a shortcut hint wears, wherever it appears. The chip is chrome, so it stays muted and never takes the accent. */ .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--font-xs); font-weight: 600; line-height: 1; white-space: nowrap; } /* Loading text */ .analyze-modal-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-lg); } .analyze-loading-text { font-size: var(--font-sm); color: var(--text-muted); } /* Larger tab close button */ .analyze-tab-close { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: var(--space-xs); border-radius: var(--radius-round); font-size: var(--font-icon); line-height: 1; color: var(--text-muted); transition: all var(--transition-fast); } .analyze-tab-close:hover { background: var(--negative); color: var(--on-danger); } /* Focus visible for accessibility */ #analyze-modal input:focus, #analyze-modal button:focus { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); } /* Split charts layout (e.g., 1D/1H) */ .split-charts { display: grid; grid-template-columns: 1fr 1fr; } .split-charts stock-chart-card { border: none; border-radius: var(--radius-none); } .split-charts stock-chart-card:first-child { border-right: 1px solid var(--border); } /* ── Symbol widgets: analyze modal (sw-*) + dashboard (dash-*) ─── Per-symbol widget cards (Stock Info / News / SEC Filings / Dilution) mounted by features/shared/symbol-widgets.ts and by the dashboard. The inner markup is identical in both, so the pieces below are unprefixed base classes owned here; sw-* / dash-* only carry the card shell. */ .sw-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--space-sm); margin-top: var(--space-sm); } .sw-widget { display: flex; flex-direction: column; min-width: 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; } .sw-widget__head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); font-weight: 600; font-size: var(--font-sm); color: var(--text); background: linear-gradient( 180deg, color-mix(in srgb, var(--accent) 3.5%, transparent), transparent ); } .sw-widget__body { flex: 1; min-height: 0; overflow-y: auto; } .sw-widget__placeholder { color: var(--text-dim); font-size: var(--font-sm); } .sw-widget[data-sw-widget="info"] .sw-widget__body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: var(--space-sm); padding: var(--space-md); align-content: start; } .sw-widget[data-sw-widget="news"] .sw-widget__body, .sw-widget[data-sw-widget="filings"] .sw-widget__body { display: flex; flex-direction: column; padding: var(--space-xs) var(--space-md) var(--space-sm); } .sw-widget[data-sw-widget="dilution"] .sw-widget__body { padding: var(--space-md); } .info__cell { min-width: 0; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); } .info__full { grid-column: 1 / -1; } .info__label { margin-bottom: var(--space-2xs); font-size: var(--font-xxs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); white-space: nowrap; } .info__value { font-size: var(--font-md); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .info__headline { font-size: var(--font-sm); line-height: 1.5; color: var(--text-secondary); } .info--up { color: var(--positive); } .info--down { color: var(--negative); } .info__desc { margin: 0; font-size: var(--font-sm); line-height: 1.55; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; } .news-item { padding: var(--space-sm) var(--space-xs); border-bottom: 1px solid color-mix(in srgb, var(--accent) 6%, transparent); min-width: 0; } .news-item:last-child { border-bottom: none; } .news-link { display: block; color: var(--text-secondary); font-size: var(--font-sm); line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; } .news-link:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: var(--space-2xs); } .news-time { margin-top: var(--space-2xs); font-size: var(--font-xs); color: var(--text-dim); } .filing { display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-sm) var(--space-xs); border-bottom: 1px solid color-mix(in srgb, var(--accent) 6%, transparent); min-width: 0; } .filing:last-child { border-bottom: none; } .filing__form { flex-shrink: 0; font-size: var(--font-xxs); font-weight: 700; letter-spacing: 0.05em; padding: var(--space-2xs) var(--space-xs-plus); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); } .filing__meta { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2xs); } .filing__link { color: var(--text-secondary); font-size: var(--font-sm); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; } .filing__link:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: var(--space-2xs); } .filing__date { font-size: var(--font-xs); color: var(--text-dim); } /* The per-row "jump to the source" chip. The filing description itself now opens the in-app Research reader, so EDGAR needs its own small target rather than being the row's only link. `.filing__meta` is a column, so the chip aligns to its own start edge. */ .filing__edgar { align-self: flex-start; margin-top: var(--space-xs); padding: 0 var(--space-xs); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); font-size: var(--font-xs); letter-spacing: 0.04em; text-decoration: none; white-space: nowrap; } .filing__edgar:hover { color: var(--text-primary); border-color: var(--text-dim); } .dilution-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: var(--space-sm); margin-top: var(--space-md); } /* Cross-link from the summary Dilution Risk Profile (Dashboard + Analyze widgets) into the per-symbol dilution page that owns the depth. Shared by both cards, so it lives here next to .dilution-metrics. */ .dilution-page-link { display: inline-block; margin-top: var(--space-sm); color: var(--text-secondary); font-size: var(--font-sm); text-decoration: none; } .dilution-page-link:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: var(--space-2xs); } .sw-drp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-md); } @media (width <= 768px) { .sw-widgets { grid-template-columns: 1fr; } } #analyze-modal input:focus-visible, #analyze-modal button:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); } /* Chinese Profile Badge */ .chinese-badge { position: relative; display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--radius-sm); font-size: var(--font-sm); font-weight: 700; cursor: help; line-height: 1.4; } .chinese-badge--high { background: color-mix(in srgb, var(--negative) 12%, transparent); color: var(--negative); border: 1px solid color-mix(in srgb, var(--negative) 25%, transparent); } .chinese-badge--medium { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); } .vol-rel { font-weight: 400; opacity: 0.7; } .events-recent { animation: pulse-recent 1.5s ease-in-out infinite; } @keyframes pulse-recent { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } } .analyze-gap-hist .positive { color: var(--positive); } .analyze-gap-hist .negative { color: var(--negative); } .analyze-gap-hist .muted { color: var(--text-muted); } /* ════════════════════════════════════ Responsive — Analyze Modal ════════════════════════════════════ */ @media (width <= 768px) { /* Stack split charts before the 480px query kicks in — two panels otherwise get squeezed into ~250-380px grid cells inside a modal capped at max-width: 95vw. */ .split-charts { grid-template-columns: 1fr; } .split-charts stock-chart-card:first-child { border-right: none; border-bottom: 1px solid var(--border); } /* Wrap metric/catalyst text instead of silently clipping it */ .analyze-compact-bar { flex-wrap: wrap; white-space: normal; } .analyze-metrics-line { flex-wrap: wrap; white-space: normal; overflow: visible; } /* Enlarge undersized header/action touch targets */ .analyze-clear-header-btn, .analyze-watchlist-btn { width: var(--touch-min); height: var(--touch-min); } .analyze-research-btn { height: var(--touch-min); padding: 0 var(--space-md); } } @media (width <= 480px) { .analyze-modal-content { width: 100%; max-width: 100vw; max-height: var(--viewport-h); border-radius: var(--radius-none); } .analyze-modal-header { flex-wrap: wrap; padding: var(--space-xs); } /* Enlarge close button for mobile touch targets (min 44x44) */ .modal-close-btn { width: var(--touch-min); height: var(--touch-min); font-size: var(--font-xl); } .analyze-modal-tabs { padding: var(--space-xs) var(--space-xs); } .analyze-tab { padding: var(--space-xs) var(--space-sm); font-size: var(--font-xs); } /* Hide keyboard shortcut hints on mobile — not usable */ .analyze-shortcuts-hint { display: none; } /* Show swipe-to-close hint instead */ .analyze-modal-footer::after { content: "Swipe down to close"; display: block; text-align: center; font-size: var(--font-xs); color: var(--text-muted); padding-top: var(--space-xs); } } /* ── Keyword highlighting (features/analyze/highlight-service.js) ── */ .hl-positive { color: var(--positive); font-weight: 600; } .hl-negative { color: var(--negative); font-weight: 600; } .hl-neutral { color: var(--accent); font-weight: 600; } .hl-corporate { color: var(--catalyst); font-weight: 600; } .hl-number { color: var(--text-primary); font-weight: 700; } /* ── Board of Directors (tooltip) ── */ /* .live-signals-pref is still used by chart-alerts-panel.js's sound-toggle label — the rest of this former "Watchlist live signals" feature (panel, drawer, per-signal rows) was removed as dead. */ .live-signals-pref { display: inline-flex; align-items: center; gap: var(--space-xs); cursor: pointer; } /* ═══════════════════════════════════════════════════════════════════════ ALERTS PANEL & DIALOG — TradingView-style alert system ═══════════════════════════════════════════════════════════════════════ */ /* ── Alerts Panel (right-docked, like Watchlist/Level2/Screener) ── */ .chart-alerts-panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--chart-min-width); max-width: 100vw; background: var(--bg-elevated); border-left: 1px solid var(--border); z-index: var(--z-1000); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--transition-base); overflow: hidden; } .chart-alerts-panel:not(.hidden) { transform: translateX(0); } .chart-alerts-panel .chart-panel-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md); border-bottom: 1px solid var(--border); flex-shrink: 0; gap: var(--space-sm); } .chart-alerts-panel .chart-panel-title { font-size: var(--font-lg); font-weight: 700; } .chart-alerts-tabs { display: flex; gap: var(--space-xs); flex: 1; } .chart-alerts-tab { flex: 1; padding: var(--space-xs) var(--space-sm); font-size: var(--font-xs); font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; } .chart-alerts-tab:hover { color: var(--text); background: var(--bg); border-color: var(--border); } .chart-alerts-tab.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); } .chart-alerts-tab:disabled { opacity: 0.4; cursor: not-allowed; } .chart-alerts-list { flex: 1; overflow-y: auto; padding: var(--space-sm); display: grid; gap: var(--space-xs); } .chart-alerts-empty { padding: var(--space-xl) var(--space-md); text-align: center; color: var(--text-muted); font-size: var(--font-sm); line-height: 1.6; } .chart-alerts-empty p:first-child { font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-xs); } /* The two alert systems share one word and nothing else (D4), so each panel says which one it is and where the other one lives. */ .chart-alerts-crosslink { padding: var(--space-xs) var(--space-md); border-bottom: 1px solid var(--border); color: var(--text-dim); font-size: var(--font-xs); line-height: 1.5; } .chart-alerts-crosslink strong { color: var(--text-secondary); font-weight: 600; } .chart-alerts-crosslink a { color: var(--text-secondary); } .chart-alerts-crosslink a:hover { color: var(--text-primary); } .chart-alert-item { display: grid; grid-template-columns: 1fr auto; gap: var(--space-sm); padding: var(--space-sm); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--transition-fast); } .chart-alert-item:hover { border-color: var(--accent); } .chart-alert-item--triggered { border-color: var(--positive); background: var(--positive-bg); } .chart-alert-item--just-triggered { animation: alert-trigger-flash 0.5s ease; } .chart-alert-item__main { min-width: 0; } .chart-alert-item__header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-xs); flex-wrap: wrap; } .chart-alert-symbol { font-weight: 700; font-size: var(--font-md); color: var(--accent); } .chart-alert-status { display: inline-flex; align-items: center; padding: 1px var(--space-xs-plus); border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; } /* The status washes come from the tokens, not from literals. The two literals this block used to carry were 15% and 10% of #828694 — the neutral grey that has no tint token — so the ladder is expressed with the two tokens that do: --accent-bg for the stronger pair, --overlay-1 for the weaker one. Both are lighter than what they replace, so the muted and dim text above gains contrast. The remaining sub-4.5:1 pairs are the badge contrast finding (appendix A4, Wave 5.2), which is decision gated and not touched here. */ .chart-alert-status--active { background: var(--positive-bg); color: var(--positive); } .chart-alert-status--triggered { background: var(--negative-bg); color: var(--negative); } .chart-alert-status--expired { background: var(--accent-bg); color: var(--text-muted); } .chart-alert-status--disabled { background: var(--overlay-1); color: var(--text-dim); } .chart-alert-item__details { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-size: var(--font-xs); color: var(--text-secondary); line-height: 1.5; } .chart-alert-type { font-weight: 600; color: var(--text); } .chart-alert-condition { color: var(--warning); } .chart-alert-price { font-family: var(--font-mono); font-weight: 600; } .chart-alert-drawing { color: var(--text-muted); } .chart-alert-name { font-style: italic; color: var(--text-muted); } .chart-alert-item__meta { margin-top: var(--space-xs); font-size: var(--font-xs); color: var(--text-dim); } .chart-alert-item__actions { display: flex; gap: var(--space-xs); flex-shrink: 0; } /* ── Alert Dialog (modal) ── */ .chart-alert-dialog-overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--black) 60%, transparent); z-index: var(--z-max); display: flex; align-items: center; justify-content: center; padding: var(--space-md); animation: fadeIn 0.15s ease; } .chart-alert-dialog-overlay.hidden { display: none; } .chart-alert-dialog { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); width: 100%; max-width: var(--dialog-width-sm); max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); } .chart-alert-dialog__header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md); border-bottom: 1px solid var(--border); flex-shrink: 0; } .chart-alert-dialog__header h2 { margin: 0; font-size: var(--font-lg); font-weight: 700; } .chart-alert-dialog__close { background: none; border: none; color: var(--text-muted); font-size: var(--font-xxl); line-height: 1; cursor: pointer; padding: var(--space-xs); transition: color var(--transition-fast); } .chart-alert-dialog__close:hover { color: var(--text); } .chart-alert-dialog__tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0; overflow-x: auto; } .chart-alert-dialog-tab { padding: var(--space-sm) var(--space-md); font-size: var(--font-sm); font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-bottom: var(--space-2xs) solid transparent; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; } .chart-alert-dialog-tab:hover { color: var(--text); } .chart-alert-dialog-tab.active { color: var(--accent); border-bottom-color: var(--accent); } .chart-alert-dialog-tab:disabled { opacity: 0.4; cursor: not-allowed; } .chart-alert-dialog__content { flex: 1; overflow-y: auto; padding: var(--space-md); } .chart-alert-dialog-panel { display: none; flex-direction: column; gap: var(--space-md); } .chart-alert-dialog-panel.active { display: flex; } .chart-alert-dialog-empty { padding: var(--space-xl); text-align: center; color: var(--text-muted); line-height: 1.6; } .chart-alert-dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-sm); padding: var(--space-md); border-top: 1px solid var(--border); flex-shrink: 0; } /* Responsive alerts panel */ @media (width <= 768px) { .chart-alerts-panel { width: 100vw; } .chart-alert-dialog { max-width: 100%; max-height: 100%; border-radius: var(--radius-none); } } .ac-pill.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; } .ac-minmax-row .modal-input { width: 120px; min-width: 0; } /* ── Shared alert builder (features/shared/alert-builder.js) ──────────── */ .alb-test-field .modal-input { width: 110px; min-width: 0; } .alb-test-progress .bt-progress-track { flex: 1; } /* Backtest progress bar — page component promoted here because the shared alert builder's test tab reuses it on pages that never load backtest.css. */ .bt-progress-track { flex: 1; height: var(--space-sm); background: var(--bg-input); border-radius: var(--radius-md); overflow: hidden; } .bt-progress-fill { height: 100%; width: 0%; background: var(--success); transition: width var(--transition-slow); } /* Inline text-style button (shared builders' disclosure toggles). */ .btn-link { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0; font-family: var(--font-sans); font-size: var(--font-sm); transition: color var(--transition-fast); } .btn-link:hover { color: var(--text-primary); } /* ── Signal alert DSL editor (backtest + dashboard alert widget) ── The builder modal this replaces was an overlay; this renders inline on both pages, so its only layout rule is the one wrapper. Everything else borrows the shared primitives (filter-textarea, preset-item, rac-issue status rows, btn-link). */ .alert-dsl-editor { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); } .alert-dsl-editor__saved, .alert-dsl-editor__form { display: flex; flex-direction: column; gap: var(--space-sm); } .alert-dsl-editor__saved-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); } .alert-dsl-editor__saved-title { color: var(--text-secondary); font-size: var(--font-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; } .alert-dsl-editor__list { max-height: var(--picker-list-height); overflow-y: auto; } .alert-dsl-editor__empty { font-size: var(--font-sm); } .alert-dsl-editor__summary { font-size: var(--font-xs); display: block; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .alert-dsl-editor__field { display: flex; flex-direction: column; gap: var(--space-xs); } .alert-dsl-editor__label { color: var(--text-secondary); font-size: var(--font-sm); font-weight: 600; display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); } .alert-dsl-editor__scope { font-size: var(--font-xs); margin: 0; line-height: 1.4; } .alert-dsl-editor__scope a { color: var(--accent); } .alert-dsl-editor__field-error { color: var(--danger); font-size: var(--font-xs); } .alert-dsl-editor__dsl { font-family: var(--font-mono); font-size: var(--font-xs); resize: vertical; width: 100%; } .alert-dsl-editor__preview { display: flex; flex-direction: column; gap: var(--space-xs); } .alert-dsl-editor__summary-line { color: var(--text); font-size: var(--font-sm); margin: 0; padding: var(--space-xs) var(--space-sm); background: var(--surface-raised); border-radius: var(--radius-sm); line-height: 1.4; } .alert-dsl-editor__unconvertible { margin: 0; } .alert-dsl-editor__status { font-size: var(--font-sm); } .alert-dsl-editor__actions { display: flex; align-items: center; gap: var(--space-sm); } .alert-dsl-editor__actions .btn-danger { margin-left: auto; } /* Lint/issue rows, kept under the old prefix: the preview, the add-widget clone and the smoke tests reference the rac-issue classes. */ .rac-issue { font-size: var(--font-xs); line-height: 1.4; border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); background: var(--info-bg); color: var(--text); } .rac-issue--warning { background: var(--warning-bg); } .rac-issue--error { background: var(--negative-bg); color: var(--danger); } /* ── Data tables ──────────────────────────────────────────────── One base for every data table in the app. Feature tables keep their own column widths, header treatment and row states on top of it; this only owns what every table needs: a collapse that doesn't double the borders, a padding floor for th/td, tabular figures so numeric columns line up, and a wrapper that scrolls sideways with momentum on touch. (No scroll shadow here: it needs an opaque base color per surface, and the tables sit on --bg, --bg-elevated and --surface alike.) */ .data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; } .data-table th, .data-table td { padding: var(--table-cell-pad-y) var(--table-cell-pad-x); font-size: var(--table-font-size); text-align: left; vertical-align: middle; } /* The canonical table header (decision 4.2). Five tables wrote this five ways — three font sizes, two tracking values, three text colours, four sticky backgrounds — and every one of them also carries `.data-table`, so the overrides were winning over the base by being last. This is the one definition: a page's table class owns its cell padding, its column widths and its sticky background (a table on a card and a table on the page are not the same surface), and nothing else about the header. */ .data-table th { position: sticky; top: 0; z-index: var(--z-1); background: var(--bg-elevated); border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; } /* ── The surface primitive (decision 10.3) ───────────────────────────────── One card body. `background: var(--bg-elevated)` + a 1px border + a radius was written ~130 times, which is not 130 decisions: the audit's count included hover and active states, badges and cells, none of which a class on the element can express. What is left is the container set — a panel, a section, a dialog body, a card — and this is it. --surface-1/2/3 are the three elevations a page tier can remap, so a tier that restyles its shell restyles its cards by overriding three tokens instead of every rule that paints one. */ .surface { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); } /* .floating-tooltip also carries the .surface class; --surface-1 is never defined, so .surface alone leaves the tooltip transparent. This compound selector beats .surface in specificity, giving the tooltip an opaque background. */ .surface.floating-tooltip { background-color: var(--surface); } .surface-2 { background: var(--surface-2); } .surface-3 { background: var(--surface-3); } .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; } /* ── Accessibility: forced colors & increased contrast ─────────────────── The P&L sign is carried by a translucent tint (--positive-bg / --negative-bg) on a card. Forced-colors flattens every background to the system canvas, so the tint vanishes and the number falls back to the system text colour: the sign is gone. Nothing here hardcodes a palette — the user still picks the colors — what we add is a second, non-color channel for the sign, and firmer borders where a border was the only thing separating two surfaces. The card selectors below are the real card bodies. They used to lead with `.card`, which no stylesheet defines and no markup uses, so high-contrast mode was strengthening the border of 4 of ~130 card implementations. */ @media (forced-colors: active) { .metric-value.positive, .metric-value.negative, .stock-row-change.positive, .stock-row-change.negative, .inspector-change.positive, .inspector-change.negative, .day-pnl { forced-color-adjust: none; border: 1px solid; border-color: currentcolor; border-radius: var(--radius-sm); } .dash-widget, .dilution-card, .dilution-chart-card, .trade-chart-panel, .playbook-card, .fh-preset-card, .sw-dilution-card, .inspector-chart-card, .data-table th, .data-table td { border-color: CanvasText; } } /* Increased contrast (not the Windows HC mode): keep the palette, but make the state borders carry more weight so a tinted card still reads as a card. */ @media (prefers-contrast: more) { .dash-widget, .dilution-card, .dilution-chart-card, .trade-chart-panel, .playbook-card, .fh-preset-card, .sw-dilution-card, .inspector-chart-card, .data-table th, .data-table td { border-width: var(--space-2xs); } .metric-value, .day-pnl, .stock-row-change { font-weight: 700; } } /* ── Flip card (chart notes) ────────────────────────────────────── Every chart in the app flips on the Y axis to reveal a notes face. Three rules keep this from being a layout change: - the wrapper declares no padding, border or margin, so the chart keeps the exact box it had before the flip existed; - the back face is `position: absolute; inset: 0`, so it covers the front rather than competing with it for height. The front face is the only thing that contributes height, on both faces; - the two faces are stacked with grid inside that wrapper, so a face is a grid item and stretches to the wrapper the same way a bare chart did. Rotating (rather than swapping the faces) also leaves the chart's own box untouched mid-transition, so the canvas is never asked to re-measure. */ .flip-card { display: grid; /* The row is the wrapper's only child track, so it must not be `auto`: an auto track sizes to the card's content, and a card whose chart is measured by a ResizeObserver then feeds its own height back in and grows without bound (the scanner calendar's sidebar chart went from ~440px to thousands). minmax(0, 1fr) caps the track at the wrapper's own (definite) height, so a fill chart inside is bounded. */ grid-template-rows: minmax(0, 1fr); /* Same for the single column: an `auto` track lets a wide chart canvas widen the card past its wrapper, which the ResizeObserver then reads back and widens again on the next symbol switch. */ grid-template-columns: minmax(0, 1fr); position: relative; height: 100%; perspective: 1200px; } .flip-card__inner { display: grid; grid-template-areas: "face"; transform-style: preserve-3d; transition: transform var(--transition-slow); } .flip-card--flipped .flip-card__inner { transform: rotateY(180deg); } .flip-card__face { grid-area: face; /* A grid item's default `min-height`/`min-width: auto` refuses to shrink below its content, which would let the bounded tracks above be overflowed anyway. */ min-height: 0; min-width: 0; backface-visibility: hidden; } /* Only the face turned toward the reader takes pointer input, so a hidden face cannot swallow a click meant for the chart underneath it. */ .flip-card__face--front { pointer-events: auto; } .flip-card__back { transform: rotateY(180deg); pointer-events: none; position: absolute; inset: 0; display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: auto; } .flip-card--flipped .flip-card__face--front { pointer-events: none; } .flip-card--flipped .flip-card__back { pointer-events: auto; } /* ── Chart corner controls ─────────────────────────────────────── One look for the fullscreen / notes / star cluster that sits in a chart's top-right corner. The card's own two buttons are inside its shadow root and cannot read this file, so chart-card-element.ts carries the same block; tests/chart/test_chart_flip.py pins the two declarations together, because a shadow-root copy is the one thing that can silently drift. The star is slotted in from the page (its handler and active state are the page's), and a light-tree declaration always beats ::slotted() -- so this block, not the card's, is what actually styles it. */ .corner-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--icon-size); height: var(--icon-size); padding: 0; background: color-mix(in srgb, var(--black) 70%, transparent); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--font-xs); line-height: 1; cursor: pointer; } .corner-btn:hover { background: var(--text); color: var(--bg); } /* Active reads through the glyph's colour alone: a filled block was louder than the chart it sits on. */ .corner-btn.added { color: var(--warning); } .corner-btn.added:hover { color: var(--warning); background: var(--text); } /* The toggle for the charts that are not and so have no shadow root to render one in (dilution, research, level2, /chart). Same muted shape as the card's own expand button, in the same top-right corner, and absolutely positioned so it costs the chart no layout. */ .flip-card__toggle { position: absolute; top: var(--space-xs); right: var(--space-xs); /* Was the literal 20. --z-10 is the nearest row below it and every sibling inside .flip-card sits at auto (0): the toggle only has to clear the back face and the chart canvas. Note .flip-card is position:relative with no z-index, so it is NOT a stacking context and this value competes in the page's context rather than the card's. --z-10 keeps the claim as small as the behaviour needs; the audit's "each literal is inside its own stacking context" does not hold for this one. */ z-index: var(--z-10); padding: var(--space-2xs) var(--space-xs-plus); font-family: var(--font-sans); font-size: var(--font-xs); font-weight: 600; line-height: 1; color: var(--text-muted); background: color-mix(in srgb, var(--black) 70%, transparent); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; } .flip-card__toggle:hover { background: var(--text); color: var(--bg); } .flip-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; } .flip-card__notes-label { font-size: var(--font-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); } .flip-card__notes { flex: 1; width: 100%; min-height: 120px; padding: var(--space-sm); background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: var(--font-sm); line-height: 1.5; resize: vertical; } .flip-card__notes:focus { border-color: var(--border-focus); outline: none; } .flip-card__notes:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); } .flip-card__actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; } .flip-card__saved { font-size: var(--font-xs); color: var(--text-muted); opacity: 0; transition: opacity var(--transition-base); } .flip-card__saved--visible { opacity: 1; } /* The chart expands to fullscreen with `:host(.expanded) { position: fixed; inset: 0 }`. Three things above -- `perspective`, `preserve-3d` and the `rotateY` on a flipped card -- each make an element the containing block for fixed-position descendants, so while any of them was in effect the expanded chart resolved `inset: 0` against the wrapper instead of the viewport and came out clipped to the card's own 440x341 box. Drop all three for as long as a chart is expanded, so `fixed` means fixed to the viewport again -- including the case where the card was already flipped to its notes face. */ .flip-card:has(stock-chart-card.expanded) { perspective: none; } .flip-card:has(stock-chart-card.expanded) .flip-card__inner { transform-style: flat; transform: none; } @media (prefers-reduced-motion: reduce) { .flip-card__inner { transition: none; } } /* ── Touch targets ─────────────────────────────────────────── Dense desktop controls keep their size on phones: the Signal/Full toggle is 19px tall and the tab bars are 24px. On a coarse pointer these get a 32px hit height, which is above the 24px WCAG floor and below the 44px platform ideal on purpose: the surrounding layout was built for the denser size. */ @media (pointer: coarse) { .mode-btn, .tab, .backtest-tab, .trades-tab, .tf-btn { min-height: var(--tab-height); } } /* ── Touch floor ────────────────────────────────────────────────────────── The desktop chrome is compact (26-28px). On touch-sized viewports every interactive control keeps a 40px floor, so the compact tokens never shrink a finger target. min-height/min-width leave wider or taller controls alone. */ @media (width <= 1024px) { .tab, .btn, .dash-tab, .trades-tab, .backtest-tab, .view-toggle, .view-toggle .view-btn, .tf-btn, .mode-btn, .input-field, .select-field { min-height: var(--touch-compact); } .chart-tool-btn { min-width: var(--touch-compact); min-height: var(--touch-compact); } /* A checkbox or radio with its text in a