/* styles/wave52/sheet-grid.css — this wave's OWN stylesheet (W52-T06, contract C7). ═══════════════════════════════════════════════════════════════════════════════════════════ ⛔⛔ THIS FILE IS THE FENCE. Wave 52's other lanes carry their own `styles/wave52/*.css`; nothing here may touch `index.css` or any earlier wave's sheet.css. Every selector below is either brand new (the `formula-assist-*` / `sheet-formula-*` families) or a POSITIONING-ONLY rule laid under a class that is already declared, UNSCOPED, at top level elsewhere (`cg-pop`, `cg-type-list`, `cg-type-row` in index.css; `FormulaBar.tsx`'s prior dropdown used the same trio, so nothing here re-declares their surface, only where they sit). ⛔ TOKENS ONLY: no literal font-size (only `--lp-fs-*`), no literal colour (only `--lp-*`), no literal z-index (only `var(--cg-z-*)`, and `cg-pop` already carries one). The one exception the whole app already makes is a reference's OWN colour, which is data (CR-4's six-slot rotation computed by `refColors.ts`) rather than styling, so it rides an INLINE style in the component, never a class in this file. ⚠ DESIGN CONTRACT: a transient overlay over a dense grid. No layout shift on open (both panels are `position: absolute`, so the grid underneath never reflows), dismiss on Escape (owned by the component that mounts `FormulaAssist`), never traps focus, and the only permitted motion is the panel's own open/close — never an animation keyed to a keystroke. ═══════════════════════════════════════════════════════════════════════════════════════════ */ /* ── the assist itself: unwrapped, so it never introduces a box into a flex row (FormulaBar's `.sheet-fx-field` is `display: flex`, and an extra block child would size oddly inside it) ── */ .formula-assist { display: contents; } /* ⚠ ABSOLUTE, under the caller's OWN `position: relative` wrapper (`.cg-pop-wrap` in FormulaBar, `.sheet-formula-editor-input-wrap` in the grid's floating editor). `cg-pop` already carries the surface, the border, the shadow and `z-index: var(--cg-z-menu)`; only placement is this file's. */ .formula-assist-list { position: absolute; top: calc(100% + 4px); left: 0; max-height: 232px; min-width: 260px; } .formula-assist-summary { margin-left: auto; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--lp-fs-2xs); color: var(--lp-muted); } /* ST-12: below and left aligned with the cell/input by default. */ .formula-assist-tip { position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ST-12/ST-15: when the dropdown ALSO owns the space below, the tooltip moves above so the two never overlap. */ .formula-assist-tip--above { top: auto; bottom: calc(100% + 4px); } .formula-assist-tip-sig { font-size: var(--lp-fs-2xs); color: var(--lp-ink); } /* ST-4: the argument currently being typed. */ .formula-assist-tip-bold { font-weight: 600; color: var(--lp-ink); } /* CR-1/CR-5: a reference's colour is DATA (an inline style from `refColors.ts`), not a class; this only sets the weight every coloured span shares. */ .formula-assist-ref { font-weight: 600; } /* ── FormulaBar.tsx's own coloured backdrop (CR-1), matching `.sheet-fx-input`'s box exactly (`styles/wave50/sheet.css::.sheet-fx-input`: `padding: 3px 8px; border: 1px solid var(--lp-line); border-radius: var(--lp-r-md); font-size: var(--lp-fs-xs);`) so the two align pixel for pixel. `border-color: transparent` keeps the SAME box, invisibly. ────────────────── */ .formula-assist-backdrop-bar { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; white-space: pre; overflow: hidden; padding: 3px 8px; border: 1px solid transparent; border-radius: var(--lp-r-md); font-size: var(--lp-fs-xs); color: var(--lp-ink); box-sizing: border-box; } .formula-assist-input-bar--colored { color: transparent; caret-color: var(--lp-ink); } /* ── SheetGrid.tsx's own floating formula editor (PM-1..PM-18), positioned via `getBounds()` on the cell being edited. `position: fixed` so it survives the canvas's own scroll and reads the same rect the library itself reports (screen space), matching every other `AnchoredOverlay` anchor already rectangle-based in this file. ────────────────────────────────────────────── */ .sheet-formula-editor { position: fixed; z-index: var(--cg-z-menu); display: flex; flex-direction: column; } .sheet-formula-editor-input-wrap { position: relative; display: flex; width: 100%; height: 100%; } /* The coloured backdrop UNDER a transparent-text input (CR-1: a plain input cannot show more than one text colour, so the visible glyphs are painted here and the real input's own text is made transparent while a reference is present -- see `.sheet-formula-editor-input--colored`). Padding, border and font must match the input exactly or the two would not align pixel for pixel. */ .sheet-formula-editor-backdrop { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; white-space: pre; overflow: hidden; padding: 0 7px; border: 1px solid transparent; font-size: var(--lp-fs-xs); color: var(--lp-ink); box-sizing: border-box; } .sheet-formula-editor-input { width: 100%; height: 100%; box-sizing: border-box; font: inherit; font-size: var(--lp-fs-xs); color: var(--lp-ink); background: var(--lp-surface); border: 1px solid var(--lp-blue-deep); border-radius: var(--lp-r-sm); padding: 0 7px; } /* CR-1: text made transparent so the coloured backdrop shows through; the caret stays visible on its own channel, which is CR-7's "colour is never the only channel" -- the caret and the grid border both still say where the caret and the reference are without relying on hue alone. */ .sheet-formula-editor-input--colored { color: transparent; caret-color: var(--lp-ink); } /* PM-18: the mode indicator. Cheap on purpose, it is the one thing the whole of Part A is tested against. Sits inside the editor's own box so it moves with the cell rather than the viewport. */ .sheet-formula-mode { align-self: flex-end; margin-top: 2px; padding: 1px 6px; border-radius: var(--lp-r-sm); background: var(--lp-surface-2); color: var(--lp-muted); font-size: var(--lp-fs-2xs); font-weight: 600; pointer-events: none; } .sheet-formula-mode--point { background: var(--lp-blue-tint); color: var(--lp-blue-deep); }