File size: 29,448 Bytes
82cdb59
 
 
 
 
 
367a695
 
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1fc133
 
367a695
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367a695
 
82cdb59
 
367a695
 
 
 
82cdb59
 
367a695
82cdb59
367a695
82cdb59
367a695
82cdb59
 
367a695
 
 
82cdb59
 
367a695
 
 
82cdb59
 
367a695
 
 
 
82cdb59
 
367a695
 
82cdb59
 
367a695
 
 
82cdb59
 
 
 
 
 
 
 
367a695
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367a695
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1fc133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
/* wave 54 -- the INSERT TAB's own ribbon layout (base kit 2a, filled by W54-T10).

   ⭐ IMPORTED BY `sheet/ribbonInsert.tsx`, a component-owned side-effect import, for the reason
   `wave52/ribbon.css`'s own header sets out: `index.css` is shared across every lane and a line
   there is the trivial-but-collision-prone edit.

   The shared vocabulary is not redeclared globally here. Insert-only size overrides below
   match Home's large Paste role. `.sheet-ribbon-btn`, `.sheet-ribbon-icon`,
   `.sheet-ribbon-caret`, `.sheet-ribbon-slot`, `.sheet-ribbon-group`, `.sheet-ribbon-group-name`,
   `.sheet-ribbon-group-controls`, `.sheet-ribbon-scroll` and `.sheet-ribbon-item` are painted by
   `styles/wave50/sheet.css` and `styles/wave51/sheet-engine.css` for EVERY tab, unscoped, so a
   group in this tab inherits all of it by using the same `group(...)` and `control(...)` helpers
   the shell hands every tab module.

   Tokens only: var(--lp-*); no literal font-size, no hex, no text-transform: uppercase
   (DESIGN.md section 2). */

/* ══════════════════════════════════════════════════════════════════════════════════════════════
   β›”β›” THE THREE RESTATED RULES, AND THIS BLOCK IS THE WHOLE REASON THIS FILE HAD TO EXIST.

   `styles/wave51/sheet-engine.css` scopes three ribbon-row rules to `.sheet-ribbon-home` and ONLY
   to it. The toolbar row this tab paints carries `.sheet-ribbon-insert` instead (the shell writes
   `activeTab.bodyClass` on it), so it inherits NONE of the three: the row would lose its stretch
   and its padding, every icon-plus-word control would lose the gap between the two, and a long
   caption would wrap mid word. All of it silently, with no build error and no gate going red,
   which is exactly the class of defect that only shows up in a screenshot.

   β›” RESTATED HERE RATHER THAN WIDENED THERE. Widening the selector in `sheet-engine.css` would
   mean editing a file this lane does not own while three other lanes are live in the same tree,
   and it would also make the Home row's layout depend on an edit made for the Insert row. Two
   tabs, two declarations, each owned by the module that paints it.
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* `.sheet-ribbon` supplies the padding, the hairline and the surface; the row of GROUPS needs its
   controls and their captions stacked, so the cross-axis alignment is the one override. */
.sheet-ribbon-insert {
  align-items: stretch;
  gap: 0;
  padding: 4px 8px;
}

/* A control holding a word plus an icon needs the two to sit on one baseline; the button rule
   already centres them, so all this adds is room for the pair not to touch. */
.sheet-ribbon-insert .sheet-ribbon-btn { gap: 4px; }

.sheet-ribbon-insert .sheet-ribbon-label { white-space: nowrap; }

/* R19: large and stack slots use the shared rules in wave52/ribbon.css.
   Chart split buttons and the native disabled fence below remain Insert-specific. */

/* ── the disabled fence ───────────────────────────────────────────────────────────────────────
   β›” A `<fieldset>` IS THE ONLY NATIVE WAY TO DISABLE A WHOLE GROUP OF CONTROLS AT ONCE, and the
   Insert tab needs exactly that when the page has not wired its document doors (no fake
   affordance). What it must NOT do is add a box: the element sits inside `.sheet-ribbon-scroll`
   as its single flex child, so it takes over that child's job of being the row of groups.
   ⚠ `display: contents` would be the tidier answer and is deliberately NOT used: it has known
   accessibility-tree gaps on form elements in shipping browsers, and a laid-out flex row with its
   own chrome stripped is behaviour we can see rather than behaviour we hope for. */
.sheet-ribbon-insert-fence {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ── the two small forms ──────────────────────────────────────────────────────────────────────
   Both hang off their own trigger through `AnchoredOverlay`, so they are POPOVERS and never
   modals (DESIGN.md 4). The surface, the edge and the shadow come from
   `.sheet-ribbon-pop-portal` (`styles/wave53/ribbon-pop.css`); what is added here is only the
   field stack inside it. */
.sheet-ribbon-insert-form {
  min-width: 236px;
}

.sheet-ribbon-insert-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sheet-ribbon-insert-caption {
  font-size: var(--lp-fs-3xs);
  line-height: 1;
  color: var(--lp-muted);
}

.sheet-ribbon-insert-input,
.sheet-ribbon-insert-area {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 7px;
  font: inherit;
  font-size: var(--lp-fs-xs);
  color: var(--lp-ink);
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  transition: border-color 150ms ease-out;
}

.sheet-ribbon-insert-area {
  resize: vertical;
  min-height: 56px;
}

.sheet-ribbon-insert-input:focus-visible,
.sheet-ribbon-insert-area:focus-visible {
  outline: none;
  border-color: var(--lp-blue-deep);
}

/* ── the sparkline authoring form (W54-T13) ───────────────────────────────────────────────────
   ⚠ NONE OF THIS REACHES THE SPARKLINE ITSELF. The mark is drawn on the grid's CANVAS by
   `sheet/sparkline.ts`, so no selector can touch it and its colours are `--lp-*` tokens resolved
   in code through `cellBorders.ts::tokenColour`. What is styled here is only the small form that
   asks for the two ranges. */

/* The kind the form is about, said once at the top: the three triggers are three buttons and the
   popover has to name which one opened it. Sentence case, never uppercase (DESIGN.md 2). */
.sheet-ribbon-insert-title {
  margin: 0 0 1px;
  font-size: var(--lp-fs-xs);
  line-height: 1.2;
  color: var(--lp-ink);
}

/* The mapping rule, stated on screen because it is the one thing a person cannot guess. Quiet,
   and it wraps: it is a sentence rather than a label. */
.sheet-ribbon-insert-hint {
  margin: 1px 0 0;
  max-width: 30ch;
  font-size: var(--lp-fs-3xs);
  line-height: 1.35;
  color: var(--lp-muted);
}

/* β›” A REFUSAL IS ONE SENTENCE AND IT NEVER MOVES THE FIELDS (DESIGN.md 5). It appears under the
   hint, in the destructive ink on its own tint, and says what did not divide without explaining
   the arithmetic. */
.sheet-ribbon-insert-refusal {
  margin: 1px 0 0;
  max-width: 30ch;
  padding: 4px 6px;
  font-size: var(--lp-fs-3xs);
  line-height: 1.35;
  color: var(--lp-red-deep);
  background: var(--lp-red-tint);
  border-radius: var(--lp-r-sm);
}

/* The submit button is a `.sheet-ribbon-item` row, which is already the popover's own control
   shape; it only needs to stop stretching to the full width of a flex column and to read as the
   affirmative rather than as one more menu row. */
.sheet-ribbon-insert-fields .sheet-ribbon-item {
  align-self: flex-start;
  padding-left: 10px;
  padding-right: 10px;
  color: var(--lp-blue-solid);
}

/* ⭐ Press feedback is subtle and must not change layout (DESIGN.md 4), and it answers on POINTER
   rather than on release. `:active` is the pointer-down state the browser already gives us. */
.sheet-ribbon-insert-fields .sheet-ribbon-item:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .sheet-ribbon-insert-input,
  .sheet-ribbon-insert-area {
    transition: none;
  }

  .sheet-ribbon-insert-fields .sheet-ribbon-item:active {
    transform: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════
   ⭐ THE CHART DIALOG (W54-T11, ruling R5), painted by `sheet/ChartDialog.tsx`.

   β›” EVERY SELECTOR BELOW IS TOP LEVEL, AND IT HAS TO BE. The dialog renders through `BodyPortal`,
   so it has no ancestor inside `.sheet-ribbon-insert`; a descendant selector under the toolbar row
   would match nothing at all, silently, exactly the way `styles/wave51/kit.css` explains for its
   own rules.

   β›” THE SURFACE IS NOT REDECLARED. `.lp-dialog-scrim` and `.lp-dialog` in `wave51/kit.css` are
   already the centred, token-only, portal-safe modal, and the one geometry this ticket states is
   the width, written inline beside the element that needs it. `.sheet-chart-dialog` carries no
   rule on purpose: it is the name a gate or a screenshot points at.

   Tokens only: var(--lp-*); no literal font-size, no hex, no uppercase (DESIGN.md sections 2, 3
   and 5).
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── the two source tabs ──────────────────────────────────────────────────────────────────────
   A tab set that already exists in this app (`.conn-modal-tab` in `wave49/connectors.css`) rather
   than a new control shape: quiet by default, the selected one inked and underlined. */
.sheet-chart-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--lp-line);
}

.sheet-chart-tab {
  appearance: none;
  margin: 0 0 -1px 0;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--lp-r-sm) var(--lp-r-sm) 0 0;
  font: inherit;
  font-size: var(--lp-fs-xs);
  color: var(--lp-muted);
  cursor: pointer;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

.sheet-chart-tab:hover {
  color: var(--lp-ink);
}

.sheet-chart-tab[aria-selected="true"] {
  color: var(--lp-ink);
  border-bottom-color: var(--lp-blue-solid);
}

.sheet-chart-tab:focus-visible {
  outline: 2px solid var(--lp-blue-deep);
  outline-offset: -2px;
}

/* Press feedback is subtle and must not change layout (DESIGN.md 4), and `:active` is the
   pointer-down state the browser already gives us. */
.sheet-chart-tab:active {
  transform: scale(0.97);
}

/* A FLOOR, NOT A HEIGHT, and it is measured rather than picked: 176px is the cell-range tab's own
   content (its sentence plus two rows of the gallery), so that tab shows no void under its last
   row while the panel still cannot collapse to nothing mid render. The database tab is taller and
   simply grows past it. */
.sheet-chart-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 176px;
}

.sheet-chart-caption,
.sheet-chart-note {
  margin: 0;
  font-size: var(--lp-fs-2xs);
  line-height: 1.4;
  color: var(--lp-muted);
}

/* The ribbon's chart shortcuts reuse the former, unused dialog gallery vocabulary. */
.sheet-ribbon-insert .sheet-chart-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: var(--sheet-ribbon-band);
  gap: 4px;
  margin-left: 4px;
}

.sheet-ribbon-insert .sheet-chart-kind {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: var(--lp-r-sm);
}

.sheet-ribbon-insert .sheet-chart-kind .sheet-ribbon-btn {
  height: 24px;
  padding: 0 4px;
}

.sheet-ribbon-insert .sheet-chart-kind-caret {
  display: flex;
  border-left: 1px solid var(--lp-line);
}

.sheet-ribbon-insert .sheet-chart-kind-caret .sheet-ribbon-btn {
  min-width: 16px;
  width: 16px;
  padding: 0;
}

.sheet-ribbon-insert .sheet-chart-kind-recommended .sheet-ribbon-btn {
  width: 100%;
}

.sheet-ribbon-insert .sheet-chart-kind-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A zero-length segment with a round cap IS the dot; heavier stroke is what gives it a radius. */
.sheet-ribbon-insert .sheet-chart-kind-dots {
  stroke-width: 2.2;
}

/* ── the database tab's fields ────────────────────────────────────────────────────────────────
   Controls in a row share height and baseline (DESIGN.md 4), which is what the fixed 30px below
   buys: the select, the text box and the number box are one rhythm rather than three. */
.sheet-chart-fields {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.sheet-chart-label {
  font-size: var(--lp-fs-2xs);
  color: var(--lp-muted);
}

.sheet-chart-select,
.sheet-chart-text,
.sheet-chart-number {
  width: 100%;
  height: 30px;
  box-sizing: border-box;
  padding: 0 8px;
  font: inherit;
  font-size: var(--lp-fs-xs);
  color: var(--lp-ink);
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  transition: border-color 150ms ease-out;
}

.sheet-chart-select:focus-visible,
.sheet-chart-text:focus-visible,
.sheet-chart-number:focus-visible {
  outline: none;
  border-color: var(--lp-blue-deep);
}

.sheet-chart-kindblock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── loading ──────────────────────────────────────────────────────────────────────────────────
   A skeleton over a spinner (DESIGN.md 4): it is the shape of the control that is coming, in the
   place it will appear, so nothing moves when the list lands. */
.sheet-chart-skeleton {
  height: 30px;
  border-radius: var(--lp-r-sm);
  background: var(--lp-surface-2);
  animation: sheet-chart-pulse 1200ms ease-out infinite;
}

@keyframes sheet-chart-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-chart-tab,
  .sheet-chart-select,
  .sheet-chart-text,
  .sheet-chart-number {
    transition: none;
  }

  .sheet-chart-tab:active {
    transform: none;
  }

  /* The slide becomes a short opacity change rather than nothing at all, so the skeleton still
     reads as pending. */
  .sheet-chart-skeleton {
    animation: none;
    opacity: 0.7;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════
   ⭐ THE DRAWN CHART AND ITS TWO HANDLES (W54-T12, ruling R5), painted by `sheet/SheetChart.tsx`.

   β›” THE PALETTE IS NOT REDECLARED. `pg-ser-0..3`, `pg-ax`, `pg-ax-lab`, `pg-bar`, `pg-legend*`
   and `pg-chart-svg` are declared unscoped in `index.css` for `viz/SeriesChart`, and the own-drawn
   kinds wear the same classes so the four series colours have exactly one home. What IS added
   here is the STROKE half of that palette: `.pg-ser-N` sets a `fill`, and DESIGN.md section 3 puts
   lines, dots and text on the DEEP companion rather than on the pastel, so a line mark cannot
   simply borrow a fill class.

   β›” ANCHORED, THEREFORE POINTER-TRANSPARENT. `.sheet-chart-anchor` in `styles/wave49/sheet.css`
   carries `pointer-events: none` so a chart never eats a click meant for a cell underneath it.
   The two handles are the only parts that take a pointer, and they say so one by one.

   Tokens only: var(--lp-*); no literal font-size outside the scale, no hex, no uppercase, no
   literal z-index (DESIGN.md sections 2, 3 and 5). `--lp-fs-5xs` is the documented FLOOR and is
   used here for chart axis furniture only.
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ⚠ ONE PROPERTY RESTATED, NOT A SECOND DECLARATION OF THE SURFACE. The chart's border, radius,
   background and shadow stay in `wave49/sheet.css`; the handles are absolutely placed against
   this box, so it has to be a positioning parent and it was not one before this ticket. */
.sheet-chart {
  position: relative;
}

/* The own-drawn kinds stack legend, plot and footer, and the PLOT is what absorbs the leftover
   height. Without this the shared `.sheet-chart svg { height: 100% }` rule would give the svg the
   whole box and push the footer out of a container that clips. */
.sheet-chart-plot {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  box-sizing: border-box;
}

.sheet-chart-plot .pg-chart-svg {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.sheet-chart-foot {
  margin: 2px 0 0;
  font-size: var(--lp-fs-3xs);
  line-height: 1.3;
  color: var(--lp-muted);
}

/* ── the marks the shared palette has no class for ────────────────────────────────────────── */
.sheet-chart-line {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* β›” THE STROKE HALF OF THE SERIES CYCLE, IN THE SAME ORDER AS `pg-ser-0..3` AND ON THE DEEP
   COMPANIONS. DESIGN.md 3: "Pastels are fills and tints. Text, strokes, chart lines, icons ride
   the deep companion" - a pastel line on white is not a light aesthetic, it is an unreadable one.
   Four and no more, exactly as `viz`'s own fill cycle ends on red: past four series a chart is
   read by small multiples rather than by a fifth hue. */
.sheet-chart-ink-0 { stroke: var(--lp-blue-deep); }
.sheet-chart-ink-1 { stroke: var(--lp-green-deep); }
.sheet-chart-ink-2 { stroke: var(--lp-yellow-deep); }
.sheet-chart-ink-3 { stroke: var(--lp-red-deep); }

/* An area is the region UNDER its own line, so it takes the pastel fill from the shared
   `pg-ser-N` class and only needs to stop being opaque: two overlapping areas both have to stay
   readable, or the lower series is simply erased and the chart shows fewer series than it says. */
.sheet-chart-area {
  stroke: none;
  fill-opacity: 0.42;
}

/* A dot takes its fill from the shared `pg-ser-N` class and only needs its edge quietened, so a
   cluster of overlapping points still reads as separate points. */
.sheet-chart-dot {
  stroke: var(--lp-surface);
  stroke-width: 1;
}

/* A slice is separated by the surface itself rather than by a line colour: a pie with hairlines
   between its wedges reads as a diagram, and this is a picture of a whole. */
.sheet-chart-slice {
  stroke: var(--lp-surface);
  stroke-width: 1.5;
}

.sheet-chart-ring {
  fill: none;
  stroke: var(--lp-line);
  stroke-width: 1;
}

/* Axis furniture only, and this is the documented FLOOR: a category label on a horizontal bar
   chart sits inside a 52px inset and has to fit there. */
.sheet-chart-cat {
  font-size: var(--lp-fs-5xs);
}

/* ── the move affordance and the resize handle ────────────────────────────────────────────── */
.sheet-chart-tool {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  background: var(--lp-surface);
  border-radius: var(--lp-r-sm);
  font: inherit;
  color: var(--lp-muted);
  opacity: 0.5;
  pointer-events: auto;
  transition: opacity 150ms ease-out, color 150ms ease-out;
}

/* β›”β›” QUIET, NOT HIDDEN, AND THE REASON IS A MEASURED ONE. `.sheet-chart-anchor` carries
   `pointer-events: none`, so the chart itself is never the hit target and a `:hover` reveal would
   have needed the reader to find an INVISIBLE 20px square before it appeared. Driven in a browser:
   the handle answers a pointer at opacity 0 exactly as it does at 1, which is the shape of a
   control that works in a test and cannot be found by a person. So it sits at half strength and
   comes up to full when it is actually addressed. */
.sheet-chart:hover .sheet-chart-tool,
.sheet-chart-tool:hover,
.sheet-chart-tool:focus-visible {
  opacity: 1;
}

.sheet-chart-tool:hover {
  color: var(--lp-ink);
  background: var(--lp-surface-2);
}

.sheet-chart-tool:focus-visible {
  outline: 2px solid var(--lp-blue-deep);
  outline-offset: 1px;
}

/* Press feedback answers on pointer down and must not change layout (DESIGN.md 4). */
.sheet-chart-tool:active {
  transform: scale(0.97);
}

.sheet-chart-grip {
  top: 3px;
  right: 3px;
  cursor: grab;
}

.sheet-chart-grip:active {
  cursor: grabbing;
}

.sheet-chart-corner {
  right: 1px;
  bottom: 1px;
  cursor: nwse-resize;
}

/* W60-T19 (R12): Eight plain square handles appear on the selected chart. */
.sheet-chart-handle {
  width: 10px;
  height: 10px;
  border: 1px solid var(--lp-blue-deep);
  border-radius: 2px;
  background: var(--lp-surface);
  opacity: 0;
}
.sheet-chart.is-selected .sheet-chart-handle,
.sheet-chart-handle:hover,
.sheet-chart-handle:focus-visible { opacity: 1; }
/* β›”β›” INSIDE THE BOX, NOT ON ITS EDGE, AND THE REASON IS MEASURED. `.sheet-chart` carries
   `overflow: hidden` in a stylesheet this lane may not edit, so a handle hung at -5px is clipped:
   it still has a layout box, so a measurement finds it, but it paints nothing and answers no
   pointer. Driven in the browser: with the handles at -5px an east or west drag moved the chart by
   exactly zero, while the bottom-right one, which has always sat at right:1 bottom:1, worked. All
   eight now sit where that one does. */
.sheet-chart-handle[data-handle="nw"] { top: 1px; left: 1px; cursor: nwse-resize; }
.sheet-chart-handle[data-handle="n"]  { top: 1px; left: calc(50% - 5px); cursor: ns-resize; }
.sheet-chart-handle[data-handle="ne"] { top: 1px; right: 1px; cursor: nesw-resize; }
.sheet-chart-handle[data-handle="w"]  { top: calc(50% - 5px); left: 1px; cursor: ew-resize; }
.sheet-chart-handle[data-handle="e"]  { top: calc(50% - 5px); right: 1px; cursor: ew-resize; }
.sheet-chart-handle[data-handle="sw"] { bottom: 1px; left: 1px; cursor: nesw-resize; }
.sheet-chart-handle[data-handle="s"]  { bottom: 1px; left: calc(50% - 5px); cursor: ns-resize; }

/* β›” BEATS `.sheet-chart svg { width: 100%; height: 100% }`, WHICH IS WHY IT IS WRITTEN WITH TWO
   CLASSES. That rule exists to scale the PLOT to its cell rectangle; an icon inside a handle is
   not the plot, and without this it is stretched to the size of the whole chart. */
.sheet-chart .sheet-chart-tool-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .sheet-chart-tool {
    transition: opacity 100ms ease-out;
  }

  .sheet-chart-tool:active {
    transform: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════
   ⭐ THE LINK FORM AND THE NOTE BUBBLE (W54-T14), painted by `sheet/LinkDialog.tsx`.

   β›”β›” NOTHING HERE REACHES THE TWO CELL MARKS, AND NOTHING CAN. A link's underline and a note's
   corner indicator are drawn on the grid's CANVAS by `LinkDialog.tsx::paintCellMarks`, so no
   selector in this file or any other can touch them; their colours are `--lp-*` tokens resolved
   in code through `cellBorders.ts::tokenColour`, which is the one resolver this folder has. What
   is styled below is only the two surfaces made of DOM: the authoring popover and the bubble.

   β›” BOTH ARE PORTALLED, so every selector is TOP LEVEL. A descendant selector under
   `.sheet-ribbon-insert` would match nothing at all, silently, exactly as the chart dialog's own
   block above explains.

   Tokens only: var(--lp-*); no literal font-size outside the scale, no hex, no uppercase, no
   literal z-index (DESIGN.md sections 2, 3 and 5).
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* The form is a little wider than the sparkline one: three kind buttons sit in a row and a sheet
   name is longer than an address. */
.sheet-link-form {
  min-width: 252px;
}

/* ── the three kinds ──────────────────────────────────────────────────────────────────────────
   A row of small buttons rather than a select: the choice is closed and worth seeing at a glance.
   β›” ONE HEIGHT AND ONE BASELINE ACROSS THE ROW (DESIGN.md 4), which is what `1fr` columns plus a
   shared padding buy; three buttons of three different widths would read as three control
   shapes. */
.sheet-link-kinds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.sheet-link-kind {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-md);
  font: inherit;
  font-size: var(--lp-fs-3xs);
  line-height: 1.2;
  color: var(--lp-ink);
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}

.sheet-link-kind:hover {
  background: var(--lp-surface-2);
}

.sheet-link-kind[aria-pressed="true"] {
  border-color: var(--lp-blue-solid);
  color: var(--lp-blue-solid);
}

.sheet-link-kind:focus-visible {
  outline: 2px solid var(--lp-blue-deep);
  outline-offset: 1px;
}

/* Press feedback answers on pointer down and must not change layout (DESIGN.md 4). */
.sheet-link-kind:active {
  transform: scale(0.97);
}

.sheet-link-kind-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The sheet picker joins the field rhythm the text inputs already set, rather than wearing the
   browser's own control metrics. */
.sheet-link-select {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 7px;
  font: inherit;
  font-size: var(--lp-fs-xs);
  color: var(--lp-ink);
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  transition: border-color 150ms ease-out;
}

.sheet-link-select:focus-visible {
  outline: none;
  border-color: var(--lp-blue-deep);
}

/* ── the note bubble ──────────────────────────────────────────────────────────────────────────
   β›”β›” POINTER TRANSPARENT, AND THAT IS BEHAVIOUR RATHER THAN POLISH. glide reports the hovered
   cell off the canvas UNDER this box, so a bubble that took a pointer would hide the very cell it
   is describing from the callback that opened it, and it would flicker as the pointer crossed its
   own edge.

   ⭐ THE NOTE STRATUM'S OWN COLOURS. `index.css` declares `--lp-yellow-tint` as "the overlay/note
   stratum's wash" and `--lp-yellow-deep` as "note + Pre-set tag text", which is exactly what a
   cell note is; the corner indicator on the canvas is the same deep token, so the mark and the
   bubble read as one thing. */
.sheet-note-bubble {
  max-width: 280px;
  padding: 7px 9px;
  background: var(--lp-yellow-tint);
  border: 1px solid var(--lp-yellow-deep);
  border-radius: var(--lp-r-md);
  box-shadow: var(--shell-shadow-overlay);
  pointer-events: none;
  z-index: var(--cg-z-menu);
  animation: sheet-note-in 120ms ease-out;
}

.sheet-note-bubble-text {
  margin: 0;
  font-size: var(--lp-fs-2xs);
  line-height: 1.4;
  color: var(--lp-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Opacity and transform only, 100 to 200ms, ease-out (DESIGN.md 4). */
@keyframes sheet-note-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-link-kind,
  .sheet-link-select {
    transition: none;
  }

  .sheet-link-kind:active {
    transform: none;
  }

  .sheet-note-bubble {
    animation: none;
  }
}