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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
/* ⭐⭐ WAVE 50 Β· W50-T01 (owner ruling R1, 2026-09-03) β€” THE SHARED MODE SCROLLER.
 *
 * The client render cap is retired. Grid and List paint every loaded row on the virtualised
 * canvas; the DOM card views paint a WINDOW of the same complete list. A window only works if
 * the thing it is a window ONTO can actually scroll, and `.cg-grid-box` is `overflow: hidden`
 * on purpose (the canvas owns its own scrolling and a second scrollbar around it double-scrolls
 * the header). So the mode views get their OWN scroller, one level in.
 *
 * β›” THE HEIGHT IS THE LOAD-BEARING HALF, not `overflow: auto`. An `auto` box with an unbounded
 * height never overflows, so it never scrolls: the view would mount its small window, be unable
 * to reach anything below it, and look exactly like the cap that was just deleted while passing
 * a naive node count. `flex: 1 1 auto` + `min-height: 0` inside a column-flex section whose own
 * height is 100% is what bounds it. `min-height: 0` is not decoration either - a flex item's
 * default `min-height: auto` floors at content height, which is the same unbounded box again.
 *
 * ⚠ `index.css` is NOT this ticket's file. Every rule W50-T01 needs lives here and in
 * `customer-grid/GalleryTimelineViews.css`, and this sheet is side-effect imported by
 * `CustomerGrid.tsx` beside the wave 44/45/46 sheets. A stylesheet nothing imports does nothing.
 */

.cg-mode-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

/* The two spacers that stand in for the rows a window does not mount. They carry the height of
   what is absent, so the scrollbar describes the WHOLE list and the last record is reachable.
   Full-width in either grid, and inert: a spacer is never a target. */
.cg-window-pad {
  grid-column: 1 / -1;
  pointer-events: none;
}

/* ═══ W50-T01 (R1) β€” KANBAN: the lane window's geometry ══════════════════════════════════════
 *
 * β›” EVERY NUMBER HERE IS A CUSTOM PROPERTY `viewModes.tsx` SETS INLINE, and that is the whole
 * point of the block. The lane mounts a window and reserves the rest as two spacers, so the
 * pitch it assumes and the height the browser paints have to be the same number. Two numbers
 * that agree today drift the first time either is tuned, and the drift shows up as the LAST
 * CARD BEING UNREACHABLE - the same failure the render cap produced, which is what this ruling
 * deleted.
 *
 * β›” SCOPED TO `.is-clamped`, WHICH IS THE DEFAULT MODE, AND ONLY TO IT. Item 3 (C-DISP) already
 * says the clamp "trims every card to a standard height"; until now it clamped the TEXT and let
 * the box size itself, so two cards could differ by a line. Nothing is cut by pinning the box,
 * because the box is the SUM of the pieces pinned below and the clamp already caps the content
 * at exactly that. ⚠ With the clamp OFF the title wraps on purpose, so no height is pinned
 * there and the window runs on an estimate that `guardedWindow` keeps safe.
 *
 * ⚠ THE SELECTORS CARRY `.cg-kb-cards` PURELY FOR SPECIFICITY. `index.css` owns the base rules
 * and one of them (`.cg-kbview.is-clamped .cg-kb-cell .cg-lv-v`) matches at the same weight as
 * the natural selector here would; at equal weight the winner is source order, and source order
 * between two sheets is a bundler's business rather than a contract. The extra ancestor is a
 * real one, and it decides the cascade rather than hoping. */
.cg-kbview.is-clamped .cg-kb-cards .cg-kb-card {
  height: var(--cg-kb-card-h);
  margin-bottom: var(--cg-kb-card-gap);
  overflow: hidden;
}

.cg-kbview.is-clamped .cg-kb-cards .cg-kb-title {
  height: var(--cg-kb-title-h);
  line-height: var(--cg-kb-line-h);
}

.cg-kbview.is-clamped .cg-kb-cards .cg-kb-cell {
  height: var(--cg-kb-cell-h);
  overflow: hidden;
}

.cg-kbview.is-clamped .cg-kb-cards .cg-kb-cell .cg-lv-k,
.cg-kbview.is-clamped .cg-kb-cards .cg-kb-cell .cg-lv-v {
  line-height: var(--cg-kb-line-h);
}

/* ═══ W50-T01 (R1) β€” CALENDAR: one day's chip list, and its window ═══════════════════════════
 *
 * The list is the day cell's unbounded axis: a busy day in a 32,000-order book used to mount a
 * chip per record. It is bounded here and windowed in `CalendarDayChips`.
 *
 * ⚠ `max-height` + `overflow: auto` IS a bounded scroller - the height is stated outright, so
 * there is no flex minimum to zero and nothing to inherit an unbounded height from. It is
 * deliberately shorter than the 150px `.cg-cal-cell` box that contains it, minus the day
 * number: the INNER list is the one that scrolls, and the outer cell's scrollbar stays idle.
 *
 * ⚠ A CHIP'S HEIGHT IS PINNED so the pitch is exact. `.cg-cal-chip` is already one line by
 * construction (`white-space: nowrap` + ellipsis), but "one line" is a line-height this file
 * did not previously state, and an unstated number is the drift the block above is about. */
.cg-cal-chips {
  max-height: var(--cg-cal-chips-h);
  overflow: auto;
  overscroll-behavior: contain;
}

.cg-cal-chips > .cg-cal-chip {
  height: var(--cg-cal-chip-h);
  margin-bottom: var(--cg-cal-chip-gap);
  line-height: var(--cg-cal-chip-line-h);
}

/* ═══ W50-T03 (owner instruction 1, ruling R2) β€” THE SUMMARY BAR ═══════════════════════════
 *
 * β›” THE HEIGHT IS A CONTRACT WITH THE COMPONENT, NOT A STYLE. `SummaryBar.tsx` exports
 * `SUMMARY_BAR_PX` and `CustomerGrid` hands glide `boxHeight - SUMMARY_BAR_PX`, so the canvas
 * stops exactly where this strip starts. Paint it taller and the bar covers the last row; paint
 * it shorter and a white band opens under the grid. Two numbers that agree today drift the
 * first time either is tuned β€” the same failure the kanban block above pins for the same
 * reason, and `verify_grid_ux.py` holds this declaration and that constant together.
 *
 * β›” ABSOLUTE INSIDE `.cg-grid-box`, WHICH IS ALREADY `position: relative` AND
 * `overflow: hidden` (index.css). A `position: sticky` footer needs a scrolling ancestor and
 * this box deliberately has none β€” the canvas owns its own scrolling β€” so `sticky` here would
 * compute to `static` and the bar would sit wherever the flow left it. Pinned to the bottom
 * edge is what "sticky under the grid" actually means on this surface.
 *
 * ⚠ NO NEW TOKEN AND NO LITERAL TYPE SIZE: `index.css` is not this ticket's file, and
 * `verify_ui.py` scans every stylesheet under `web/src` for a literal `font-size`.
 */
/* β›” THE PROPERTY IS DECLARED ON THE BOX, NOT ON THE BAR, AND THAT IS LOAD-BEARING. The DOM
   modes are SIBLINGS of the bar, so a value declared on the bar itself cannot reach them and
   the reserve below would silently compute to `padding-bottom: 0` - the list's last row back
   under the strip, with every source scan green. */
.cg-grid-box.has-summary {
  --cg-sum-h: 30px;
}

/* The canvas is shortened in JS (`SUMMARY_BAR_PX`) because glide is given a height as a NUMBER.
   The DOM modes lay themselves out in CSS and `viewModes.tsx` belongs to another ticket, so
   their reserve is here, keyed on the class the grid box wears only while the bar is up. */
.cg-grid-box.has-summary > .cg-listview,
.cg-grid-box.has-summary > .cg-mode-scroll {
  padding-bottom: var(--cg-sum-h);
}

.cg-sum-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--cg-sum-h);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-top: 1px solid var(--lp-line);
  background: var(--cg-panel);
  font-size: var(--lp-fs-2xs);
  color: var(--cg-muted);
}

/* The row-marker gutter. Nothing is summarised there, and the width is glide's own. */
.cg-sum-gutter {
  flex: 0 0 auto;
}

/* β›” TWO TRACKS, BECAUSE GLIDE PINS THE LEADING COLUMNS. The pinned group never moves; the
   scrolling group is clipped and translated by glide's own `tx`. One track for both would slide
   the frozen cells out from under their frozen headers on the first horizontal scroll. */
.cg-sum-pinned {
  flex: 0 0 auto;
  display: flex;
}
.cg-sum-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.cg-sum-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

/* DESIGN.md Β§4 β€” a quiet button with native chrome reset. One control shape for the whole rail:
   every cell is the same button whether or not it currently shows a value, because a cell that
   only becomes clickable once it has a number is a menu nobody can find. */
.cg-sum-cell {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-right: 1px solid var(--lp-line);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}
.cg-sum-cell.is-numeric {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.cg-sum-cell:hover:not(:disabled) {
  background: var(--cg-soft);
  color: var(--cg-text);
}
.cg-sum-cell:disabled {
  cursor: default;
}
.cg-sum-cell:focus-visible {
  outline: 2px solid var(--cg-navy);
  outline-offset: -2px;
}

/* The operation's word, quieter than its value: the number is the content, the word is its
   unit. Both are in the strip's own register, neither is bold. */
.cg-sum-agg {
  flex: 0 0 auto;
  opacity: 0.75;
}
.cg-sum-value {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--cg-text);
}

/* ── the picker ─────────────────────────────────────────────────────────────────────────── */
.cg-sum-menu {
  display: flex;
  flex-direction: column;
  max-height: min(60vh, 420px);
}
.cg-sum-opt {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 5px 8px;
  border-radius: var(--lp-r-sm);
  cursor: pointer;
}
.cg-sum-opt:hover {
  background: var(--cg-soft);
}
.cg-sum-opt.is-on {
  color: var(--cg-navy);
  font-weight: 600;
}
/* The percentile points, indented under their own heading rather than flattened into the list:
   nine top-level rows plus six points reads as fifteen unrelated choices. */
.cg-sum-pgroup {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--lp-line);
}
.cg-sum-phead {
  padding: 2px 8px;
  font-size: var(--lp-fs-3xs);
  color: var(--cg-muted);
}
.cg-sum-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}
.cg-sum-clabel {
  flex: 0 0 auto;
  color: var(--cg-muted);
}
.cg-sum-cinput {
  flex: 1 1 auto;
  min-width: 0;
}
.cg-sum-capply {
  flex: 0 0 auto;
}

/* ═══ W50-T06 (owner instruction 5, ruling R5) β€” THE FORMULA EDITOR ═════════════════════════
 *
 * Owner, verbatim: *"Formula field editor is wider when configuring (it expands) and taller by
 * default; it behaves like Excel."* The TALLER half is the component's business (`editorRows`
 * drives the `rows` attribute, so the box grows with the content); everything here is the WIDER
 * half plus the two surfaces that guidance needs.
 *
 * β›” NO `height` ON `.cg-formula-editor`, AND THAT IS THE ONE RULE THIS BLOCK MUST NOT GAIN. A
 * height here would win over the `rows` attribute, so the box would open at whatever this file
 * said and never grow again β€” while `editorRows` still returned the right number, every source
 * scan stayed green and `tsc` had nothing to say. `max-height` is safe because it caps growth
 * rather than replacing it, and the pane it lives in has to stay shorter than the screen.
 *
 * ⚠ NO LITERAL `font-size` ANYWHERE BELOW: `verify_ui.py` scans every stylesheet under
 * `web/src` whole-tree and reds on one (DESIGN.md Β§5). Tokens only, and no new token either β€”
 * `index.css` is not this ticket's file.
 */

/* β›” THE 560px IS DELIVERED BY `:has()`, NOT BY A MODIFIER CLASS, and the reason is arithmetic:
   `cg-column-menu` is set by SIX separate `AnchoredOverlay` call sites in `ColumnMenu.tsx` and
   the formula pane can appear under four of them (create, insert, change-type swap, edit). A
   class would have to be computed and threaded through all six, and the fifth one somebody
   forgets is a pane that silently stays narrow. `:has()` asks the only question that matters β€”
   is a formula being written in here β€” and it cannot be forgotten by a call site.
   ⚠ `:has()` is already in this app's supported set (`index.css` uses it for the agent panel and
   the nav badge). Specificity is 0,2,0 against index.css's 0,1,0, so this wins outright and the
   result does not depend on which sheet the bundler emits first. */
.cg-column-menu:has(.cg-formula-editor) {
  width: min(560px, calc(100vw - 16px));
}

.cg-formula-wrap {
  position: relative;
  display: block;
}

.cg-formula-editor {
  max-height: 44vh;
  overflow-y: auto;
}

/* ── the signature, which is "copy how Excel documents it" ──────────────────────────────────
 *
 * β›” IT FLOATS, IT DOES NOT REFLOW. The caret crosses a bracket on nearly every keystroke, so a
 * hint in normal flow would push the field inserter and the Create button up and down while
 * somebody types. Absolute inside `.cg-formula-wrap`, immediately under the box.
 *
 * β›” `pointer-events: none` IS LOAD-BEARING, not tidiness: it covers the "Insert a field
 * reference" control, and a hint that swallows the click on the control beneath it is a defect
 * that looks like the button being broken. Nothing here is interactive. */
.cg-formula-sig {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding: 5px 8px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  background: var(--cg-white);
  box-shadow: 0 8px 22px rgba(20, 24, 40, 0.16);
  pointer-events: none;
}

.cg-formula-sig-form {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--lp-fs-2xs);
  color: var(--cg-ink);
}

.cg-formula-sig-desc {
  font-size: var(--lp-fs-3xs);
  color: var(--cg-muted);
}

/* ── the caret-anchored listbox ─────────────────────────────────────────────────────────────
 *
 * ⚠ `AnchoredOverlay` already gives this node `cg-overlay` (body-level z-index) and a fixed
 * position measured against the CARET rect, so nothing here positions anything. */
.cg-formula-ac {
  width: min(360px, calc(100vw - 16px));
  max-height: min(46vh, 300px);
  overflow-y: auto;
  padding: 3px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-lg);
  background: var(--cg-white);
  color: var(--cg-ink);
  box-shadow: 0 12px 34px rgba(20, 24, 40, 0.17);
}

/* One option is a row, not a button: focus never leaves the textarea (that is what keeps the
   caret where the typist put it), so these are pointed at with the mouse and driven with the
   arrow keys, and `is-active` is the only selection state there is. */
.cg-formula-ac-opt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 6px;
  border-radius: var(--lp-r-sm);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.cg-formula-ac-opt.is-active {
  background: var(--cg-soft);
}

.cg-formula-ac-name {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--lp-fs-2xs);
  font-weight: 600;
  color: var(--cg-navy);
}

.cg-formula-ac-sig {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--lp-fs-3xs);
  color: var(--cg-muted);
}

/* ⭐ The alias line is why CONCAT finds CONCATENATE: the catalogue carries the synonyms, so the
   list can say which spelling the typist used without a second name in the offer. */
.cg-formula-ac-alias {
  flex: 0 0 auto;
  font-size: var(--lp-fs-3xs);
  color: var(--cg-muted);
  opacity: 0.8;
}