devpage-core 0.3.4

devpage's core: documents, rendering, link checking, comments and designs, with no I/O runtime
Documentation
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
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
/* devpage's built-in light and dark themes. Every color comes from these tokens,
   diagrams included, so a theme is a set of token values. An embedded
   design's backdrop that its own switch turned carries data-theme too, and
   takes that theme's tokens whatever the page's. */
:root, .design-embed[data-theme="light"] {
  --background: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --accent: #0066cc;
  --on-accent: #fff;
  --code: #f5f5f7;
  --syntax-keyword: #9b2393;
  --syntax-string: #c41a16;
  --syntax-number: #1c00cf;
  --syntax-comment: #5d6c79;
  --syntax-type: #0b4f79;
  --syntax-function: #326d74;
  --syntax-attribute: #815f03;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

/* Dark: chosen with the theme selector (data-theme, set before the page
   paints), or — with no choice made and no script — by the system setting. */
:root[data-theme="dark"], .design-embed[data-theme="dark"] {
    --background: #000000;
    --surface: #1d1d1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --border: #424245;
    --accent: #2997ff;
    --on-accent: #0b0b0c;
    --code: #1d1d1f;
    --syntax-keyword: #ff7ab2;
    --syntax-string: #ff8170;
    --syntax-number: #d9c97c;
    --syntax-comment: #7f8c98;
    --syntax-type: #dabaff;
    --syntax-function: #67b7a4;
    --syntax-attribute: #fd8f3f;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --background: #000000;
    --surface: #1d1d1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --border: #424245;
    --accent: #2997ff;
    --on-accent: #0b0b0c;
    --code: #1d1d1f;
    --syntax-keyword: #ff7ab2;
    --syntax-string: #ff8170;
    --syntax-number: #d9c97c;
    --syntax-comment: #7f8c98;
    --syntax-type: #dabaff;
    --syntax-function: #67b7a4;
    --syntax-attribute: #fd8f3f;
  }
}
:root[data-theme="light"], .design-embed[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"], .design-embed[data-theme="dark"] { color-scheme: dark; }


* { box-sizing: border-box; }

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Navigation */

#devpage-nav {
  position: sticky;
  top: 0;
  align-self: flex-start;
  /* The width the reader dragged it to, kept between a narrow sidebar and
     half the window; 280px until they do. */
  --shown-width: clamp(200px, var(--sidebar-width, 280px), 50vw);
  width: var(--shown-width);
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 8px 40px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.4;
}

#devpage-nav .document-title {
  display: block;
  margin-bottom: 18px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

#devpage-nav ul { list-style: none; margin: 0; padding: 0; }
/* A level costs 10px of the sidebar's width, so a page six levels down still
   has room for its title; the guide line stands under its parent's label. */
#devpage-nav ul ul { padding-left: 3px; border-left: 1px solid var(--border); margin: 0 0 2px 6px; }
#devpage-nav li { margin: 0; }
#devpage-nav a { display: block; padding: 3px 6px; border-radius: 6px; color: var(--text); text-decoration: none; }
#devpage-nav a:hover { background: var(--border); }
#devpage-nav a.current { background: var(--accent); color: var(--on-accent); }

/* A sidebar entry with children: its link and a chevron on one row, its
   children shown while it is open. */
#devpage-nav .entry { display: flex; align-items: center; gap: 2px; }
#devpage-nav .entry > a { flex: 1; min-width: 0; }
#devpage-nav .chevron {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
#devpage-nav .chevron:hover { background: var(--border); color: var(--text); }
#devpage-nav .chevron::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-1px) rotate(-45deg);
}
#devpage-nav li.open > .entry > .chevron::before { transform: translateY(-1px) rotate(45deg); }
#devpage-nav li.branch:not(.open) > ul { display: none; }

/* The sidebar's resize handle: a strip over its right edge, the height of
   the sidebar whatever it is scrolled to, dragged to set its width. */
#devpage-nav .resize {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(var(--shown-width) - 4px);
  z-index: 5;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}
#devpage-nav .resize::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.12s;
}
#devpage-nav .resize:hover::after,
#devpage-nav .resize:focus-visible::after,
:root.resizing-sidebar #devpage-nav .resize::after { opacity: 1; }
#devpage-nav .resize:focus { outline: none; }
:root.resizing-sidebar { cursor: col-resize; user-select: none; -webkit-user-select: none; }

/* The sidebar's search box, between the title and the tree, and its hits,
   which take the tree's place while the box holds text. */
#devpage-nav .search { position: relative; margin: 0 0 12px; }
#devpage-nav .search::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
#devpage-nav .search input {
  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0 30px 0 31px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#devpage-nav .search input::placeholder { color: var(--muted); }
#devpage-nav .search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
#devpage-nav .search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
#devpage-nav .search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  line-height: 16px;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
#devpage-nav .search .clear {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--muted);
  cursor: pointer;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cmask id='x'%3E%3Ccircle cx='12' cy='12' r='12' fill='white'/%3E%3Cpath d='m8 8 8 8m0-8-8 8' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/mask%3E%3Ccircle cx='12' cy='12' r='12' mask='url(%23x)'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cmask id='x'%3E%3Ccircle cx='12' cy='12' r='12' fill='white'/%3E%3Cpath d='m8 8 8 8m0-8-8 8' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/mask%3E%3Ccircle cx='12' cy='12' r='12' mask='url(%23x)'/%3E%3C/svg%3E") center / contain no-repeat;
}
#devpage-nav .search .clear:hover { background: var(--text); }
#devpage-nav .search:focus-within kbd,
#devpage-nav .search input:not(:placeholder-shown) + kbd { display: none; }

/* The results, grouped by page: the page's row, then its sections and the
   more row under it, indented on a rule as the tree's children are. */
#devpage-nav .search-page + .search-page { margin-top: 6px; }
#devpage-nav .search-sections { margin: 0 0 2px 6px; padding-left: 8px; border-left: 1px solid var(--border); }
#devpage-nav a.hit { padding: 5px 8px; scroll-margin: 8px; }
#devpage-nav a.hit:hover { background: none; }
#devpage-nav a.hit.selected { background: var(--border); }
#devpage-nav .hit-place,
#devpage-nav .hit-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#devpage-nav .hit-place { font-size: 12px; color: var(--muted); }
#devpage-nav .hit-page .hit-label { font-weight: 600; }
#devpage-nav .hit-section .hit-label { font-weight: 500; }
#devpage-nav .hit-more .hit-label { font-size: 13px; color: var(--muted); }
#devpage-nav .hit-snippet,
#devpage-nav .hit-lede {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 1px;
  font-size: 13px;
  color: var(--muted);
}
/* Muted text on the selected result's background falls below readable contrast. */
#devpage-nav a.hit.selected .hit-place,
#devpage-nav a.hit.selected .hit-snippet,
#devpage-nav a.hit.selected .hit-lede,
#devpage-nav a.hit.selected .hit-label { color: var(--text); }
#devpage-nav .hit-snippet mark {
  padding: 0 1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}
#devpage-nav .search-empty { margin: 0; padding: 4px 8px; color: var(--muted); }

/* Content */

main { flex: 1; min-width: 0; padding: 56px 48px 120px; }
article { max-width: 780px; margin: 0 auto; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 40px; font-weight: 700; margin: 0 0 24px; }
h2 { font-size: 28px; font-weight: 600; margin: 48px 0 16px; }
h3 { font-size: 21px; font-weight: 600; margin: 32px 0 12px; }
p, ul, ol, table, pre, blockquote, .diagram { margin: 0 0 20px; }
li { margin: 4px 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

blockquote {
  margin-left: 0;
  padding: 4px 20px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

code { font: 0.88em var(--font-mono); background: var(--code); padding: 2px 5px; border-radius: 5px; }
pre { background: var(--code); padding: 16px 20px; border-radius: 10px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: 14px; }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
/* A wide table scrolls inside its own box, never the page. */
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
.table-scroll > table { margin: 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }

/* A code reference page, as Apple lays out a symbol: a hero with the kind,
   the name and the abstract; the declaration on a card with its file under
   it; then what it holds, each entry a declaration with its name in bold and
   its abstract under it, between hairlines. */
.code-hero { margin: 8px 0 36px; }
.code-eyebrow { font-size: 17px; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: -0.01em; }
.code-eyebrow a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.code-hero h1 { font-size: 48px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 16px; word-break: break-word; }
.code-hero p:not(.code-eyebrow) { font-size: 22px; line-height: 1.42; letter-spacing: -0.01em; margin: 0; }
.code-declaration pre { background: var(--background); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; margin: 0; }
.code-declaration pre code { font-size: 15px; line-height: 1.6; }
.code-source { font-size: 13px; margin: 10px 2px 40px; }
.code-source a { color: var(--muted); }
.code-overview { margin: 0 0 8px; }
.code-topics h3 { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; margin: 56px 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.code-topic { padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.code-topic p { margin: 0; }
.code-topic a code { background: none; padding: 0; font-size: 15px; color: var(--accent); line-height: 1.5; }
.code-topic a code b { font-weight: 600; }
.code-topic-name code { font-family: var(--font); font-size: 17px; font-weight: 600; }
.code-topic p + p { font-size: 15px; line-height: 1.45; color: var(--muted); margin-top: 4px; }
.code-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.code-chips code { font-size: 14px; padding: 4px 10px; border-radius: 8px; }

/* Diagrams: pele draws with its own variables, mapped to the theme tokens. */

.diagram {
  --pele-bg: var(--background);
  --pele-fg: var(--text);
  --pele-muted: var(--muted);
  --pele-line: var(--muted);
  --pele-surface: var(--surface);
  --pele-surface-alt: var(--border);
  --pele-border: var(--border);
  --pele-accent: var(--accent);
  --pele-font: var(--font);
  --pele-font-mono: var(--font-mono);
  --pele-radius: 8px;
  padding: 8px 0;
  text-align: center;
}

.diagram svg { max-width: 100%; height: auto; }

.diagram-error { color: #d70015; text-align: left; white-space: pre-wrap; font: 13px var(--font-mono); }


/* Sidebar groups: the ### headings of a Topics section. */
#devpage-nav li.group { margin: 12px 0 2px; padding: 0 6px; }
#devpage-nav li.group:first-child { margin-top: 0; }
#devpage-nav ul ul li.group { margin: 8px 0 0; }
#devpage-nav ul ul li.group:first-child { margin-top: 4px; }
#devpage-nav li.group span { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* Syntax highlighting: classes name syntax scopes (see src/highlight.rs); colors
   come from the --syntax-* tokens, Xcode's default palettes. */
pre code { color: var(--text); }
.hl-comment { color: var(--syntax-comment); font-style: italic; }
.hl-string { color: var(--syntax-string); }
.hl-constant.hl-numeric, .hl-constant.hl-language { color: var(--syntax-number); }
.hl-keyword, .hl-storage { color: var(--syntax-keyword); font-weight: 600; }
.hl-storage.hl-type.hl-primitive, .hl-support.hl-type, .hl-entity.hl-name.hl-type, .hl-entity.hl-name.hl-class,
.hl-entity.hl-name.hl-struct, .hl-entity.hl-name.hl-enum, .hl-entity.hl-other.hl-inherited-class { color: var(--syntax-type); font-weight: 400; }
.hl-entity.hl-name.hl-function, .hl-support.hl-function, .hl-variable.hl-function { color: var(--syntax-function); }
.hl-entity.hl-name.hl-tag, .hl-entity.hl-other.hl-attribute-name, .hl-meta.hl-attribute, .hl-support.hl-other.hl-macro { color: var(--syntax-attribute); }

/* Diagram nodes with a `click … href` line are links: no underline; on hover the
   node's border takes the accent color. */
.diagram a { cursor: pointer; text-decoration: none; }
.diagram a:hover rect, .diagram a:hover polygon, .diagram a:hover circle,
.diagram a:hover ellipse, .diagram a:hover path { stroke: var(--accent); stroke-width: 2.5px; }

/* A doc: one long page, its outline beside it. */

.outline li.h2 { padding-left: 14px; font-size: 14px; }
.doc .chapter + .chapter { margin-top: 48px; }

/* Print mode, and the browser's own print: the page alone, in the light theme. */

@media print {
  :root { color-scheme: light; }
  #devpage-nav { display: none; }
  body { display: block; }
}
.print #devpage-nav { display: none; }

.doc-title { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }

/* Slides: each slide a 1920 × 1080 stage, scaled whole to the window. */

body.slides { display: block; background: var(--background); overflow: hidden; }
.deck .slide {
  position: absolute; top: 0; left: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background: var(--background);
  display: none;
  overflow: hidden;
}
.deck .slide.shown { display: block; }
.slide-body { padding: 96px 128px; font-size: 48px; line-height: 1.4; }
.slide-body h1 { font-size: 104px; }
.slide-body h2 { font-size: 72px; }
.slide-body h3 { font-size: 56px; }
.slide-body pre code { font-size: 30px; }
.slide-body table { font-size: 34px; }
.slide-body .diagram { font-size: 28px; }
/* Widgets on a slide look as they do on a page, magnified for the stage. */
.slide-body :is(.callout, .tabs, .example, .filetree, .terminal, .kind-cards, .steps, .cards) { font-size: 16px; line-height: 1.5; zoom: 2.2; }
.slide-body :is(.callout, .tabs, .example, .filetree, .terminal, .kind-cards, .steps, .cards) :is(table, pre code) { font-size: 14px; }
.slide-body :is(.callout, .tabs, .example, .filetree, .terminal, .kind-cards, .steps, .cards) :is(.callout, .tabs, .example, .filetree, .terminal, .kind-cards, .steps, .cards) { zoom: 1; font-size: 16px; }
.slide-body .kind-cards { zoom: 1.7; margin: 0; }
.slide-body .example { zoom: 2; margin: 0; }
.slide-body .example .example-source code { font-size: 19px; }
/* A diagram fills the room it is given. */
.slide-body .diagram svg { width: 100%; height: auto; max-height: 760px; }
.slide-body .diagram { margin: 0; padding: 0; }

@media print {
  body.slides { background: none; overflow: visible; }
  .deck .slide {
    display: block; position: relative; transform: none !important;
  }
  .deck .slide:not(:last-child) { break-after: page; }
  body.slides, .deck { margin: 0; padding: 0; }
}

/* The words a search result matched, marked in its section where it lands
   until Escape or the next navigation: one yellow, half seen through, in
   both themes. */
mark.devpage-found {
  --found: color-mix(in srgb, #ffd60a 55%, transparent);
  background: var(--found);
  color: inherit;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--found);
}

/* Comments: highlighted anchors, and threads beside the text on a wide page
   (each card level with its anchor) or, on narrow screens and decks, in a
   panel the reader opens. Never printed. */

mark.comment { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; cursor: pointer; border-radius: 2px; }
/* In a diagram the marked text takes the accent: SVG text has no background. */
tspan.comment, tspan.devpage-mark { fill: var(--accent); }
tspan.comment { cursor: pointer; }
#devpage-comments { flex-shrink: 0; font-size: 14px; line-height: 1.45; }
#devpage-comments:empty { display: none; }
#devpage-comments.beside { position: relative; width: 300px; margin: 56px 16px 0 0; }
#devpage-comments.beside > * { position: absolute; left: 0; right: 0; }
#devpage-comments:not(.beside) {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100vw);
  overflow: auto; padding: 16px; z-index: 5; display: none;
  background: var(--background); border-left: 1px solid var(--border);
}
body.show-comments #devpage-comments:not(.beside):not(:empty) { display: block; }
#devpage-comments-toggle { position: fixed; right: 16px; bottom: 16px; z-index: 6; display: none; }
#devpage-comments-toggle.shown { display: block; }
:fullscreen #devpage-comments-toggle { display: none; }
#devpage-comments .thread { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--surface); }
#devpage-comments .composer { border-color: var(--accent); }
#devpage-comments blockquote { margin: 0 0 6px; padding: 0 0 0 8px; background: none; border-left: 3px solid var(--accent); color: var(--muted); max-height: 4.4em; overflow: hidden; }
#devpage-comments p { margin: 4px 0; overflow-wrap: anywhere; }
#devpage-comments time { color: var(--muted); font-size: 12px; }
#devpage-comments h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.comment-editor textarea { width: 100%; margin: 6px 0 2px; font: inherit; color: inherit; background: var(--background); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; resize: vertical; }
.comment-editor button { margin: 4px 6px 0 0; }
.comment-error { color: #d70015; font-size: 13px; }
.comment-error:empty { display: none; }
.comment-button, #devpage-comments-toggle, .comment-editor button { font: 13px var(--font); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 9px; cursor: pointer; z-index: 4; }
.comment-button { display: inline-flex; align-items: center; gap: 6px; }
.comment-button.comment-icon { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; color: var(--muted); background: var(--background); box-shadow: 0 2px 8px -4px color-mix(in srgb, var(--text) 35%, transparent); transition: color 0.15s, border-color 0.15s; }
.comment-button.comment-icon:hover { color: var(--accent); border-color: var(--accent); }
@media print { #devpage-comments, #devpage-comments-toggle, .comment-button { display: none !important; } mark.comment { background: none; } tspan.comment, tspan.devpage-mark { fill: inherit; } }

/* Problems: broken links found while the page is previewed. */

.problems { max-width: 780px; margin: 0 auto 24px; border: 1px solid #d70015; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #d70015; }
.problems ul { margin: 4px 0 0; padding-left: 18px; }
a.broken { color: #d70015; text-decoration: underline wavy #d70015; }
img.broken { outline: 2px dashed #d70015; }
.diagram a.broken rect, .diagram a.broken polygon, .diagram a.broken circle, .diagram a.broken ellipse, .diagram a.broken path { stroke: #d70015; stroke-dasharray: 6 4; }
body.slides .problems { position: fixed; top: 8px; left: 8px; right: 8px; z-index: 3; background: var(--background); }
@media print { .problems { display: none; } }
/* Soft shadows are left out on paper: PDF viewers draw Chrome's blurred
   shadows as grey boxes. */
@media print { * { box-shadow: none !important; } }
@media print { h1, h2, h3 { break-after: avoid; } pre, .diagram, table { break-inside: avoid; } }

/* Designs: the canvas page fills the window; an embedded design sits at its
   own size, centred on a backdrop, with a link to its canvas page; an overlay
   sits over the design it dims; problems sit over the last valid drawing. */
body.design-page { margin: 0; height: 100vh; overflow: hidden; background: var(--surface); }
body.design-page > canvas.design { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; }
.design-embed { display: flex; justify-content: center; align-items: center; position: relative; margin: 24px 0; padding: 40px 24px; min-height: 120px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.design-embed > canvas.design { display: block; flex: none; border-radius: 2px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.08); }
/* The backdrop's corner: a themed design's own theme switch, then the link
   to its canvas page. */
.design-embed > .design-corner { position: absolute; top: 8px; right: 12px; z-index: 1; display: flex; align-items: center; gap: 4px; }
.design-embed a.design-open { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--background); color: var(--muted); font: 500 12px/1.5 var(--font); text-decoration: none; opacity: 0.85; transition: opacity 0.15s, color 0.15s; }
.design-embed a.design-open::after { content: " ↗"; }
.design-embed a.design-open:hover, .design-embed a.design-open:focus-visible { opacity: 1; color: var(--accent); }
@media print { .design-embed { padding: 16px; border-radius: 8px; } .design-embed > canvas.design { box-shadow: none; } .design-embed > .design-corner { display: none; } }
.design-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(15 23 42 / 0.4); }
.design-overlay.design-overlay-page { position: fixed; z-index: 2; }
.design-problems { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; margin: 0; padding: 10px 14px 10px 32px; border: 1px solid #d70015; border-radius: 10px; background: var(--background); color: #d70015; font: 13px var(--font-mono); }
/* On the canvas page the light/dark switch holds the top-right corner; the
   bars stop short of it. */
body.design-page > .design-problems { position: fixed; right: 60px; }
.design-failed { margin: 0; padding: 10px 14px; border: 1px solid #d70015; border-radius: 10px; background: var(--background); color: #d70015; font: 13px var(--font-mono); }
body.design-page > .design-failed { position: fixed; top: 8px; left: 8px; right: 60px; z-index: 3; }

/* ---- Widgets ---------------------------------------------------------- */
.callout { display: block; margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 6px; }
.callout-warning { border-left-color: #d29922; }
.callout-danger { border-left-color: #cf222e; }
.callout-tip { border-left-color: #1a7f37; }
.callout-head { display: flex; gap: 0.5rem; align-items: center; }
.callout-icon { font-weight: bold; }
.callout-body > :first-child { margin-top: 0.25rem; }
.callout-body > :last-child { margin-bottom: 0; }
.tabs { margin: 1rem 0 20px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tabs-bar { display: flex; border-bottom: 1px solid var(--border); }
.tabs-bar button { background: none; border: 0; padding: 0.5rem 1rem; color: inherit; font: inherit; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs-bar button.current { border-bottom-color: var(--accent); font-weight: 600; }
.tabs-panel { padding: 16px; }
.tabs-panel > .tab > :first-child, .tabs-panel > :first-child { margin-top: 0; }
.tabs-panel > .tab > :last-child, .tabs-panel > :last-child { margin-bottom: 0; }
.example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin: 1rem 0; }
/* Grid items may shrink below their content, so a long source line scrolls
   inside its box instead of widening the page. */
.example > * { min-width: 0; }
.example figcaption { grid-column: 1 / -1; font-weight: 600; }
.example-source { margin: 0; }
.example-result { border: 1px solid var(--border); border-radius: 6px; padding: 0 1rem; }
@media (max-width: 800px) { .example { grid-template-columns: minmax(0, 1fr); } }
.filetree ul { list-style: none; padding-left: 1.25rem; margin: 0; }
.filetree > ul { padding-left: 0; }
.filetree { font-family: var(--font-mono); margin: 1rem 0; }
.filetree-icon { display: inline-block; width: 1rem; color: var(--muted); }
.filetree-note { margin-left: 0.75rem; color: var(--muted); font-family: var(--font); }
.terminal { margin: 1rem 0; border-radius: 8px; overflow: hidden; background: #1e1e1e; color: #e6e6e6; }
.terminal figcaption { padding: 0.35rem 0.75rem; background: #333; font-size: 0.8rem; }
.terminal pre { margin: 0; background: none; color: inherit; overflow-x: auto; }
.terminal pre > div { min-height: 1.5em; }
@media print {
  /* Paper can't scroll: long lines wrap. */
  .terminal pre, .example-source { white-space: pre-wrap; overflow-wrap: anywhere; }
}
/* A task list item shows its checkbox, not a bullet as well. */
li:has(> input[type="checkbox"]), li:has(> p > input[type="checkbox"]) { list-style: none; }
li > input[type="checkbox"], li > p > input[type="checkbox"] { margin: 0 0.4em 0 -1.3em; }
.terminal-prompt { color: #7ee787; }
kbd { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; font: inherit; font-size: 0.85em; text-align: center; }
.keys kbd + kbd { margin-left: 0.2em; }
.widget-error { color: #cf222e; white-space: pre-wrap; }
div.widget-error { margin: 0 0 20px; }

/* Navbar: a site's bar across the top — its title, then its links, dropdowns
   and icons, then the theme selector. Translucent, like the page under it. */

body.with-navbar { flex-wrap: wrap; align-content: flex-start; }
#devpage-navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 100%;
  height: 52px;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.navbar-inner { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 24px; }
.navbar-title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); white-space: nowrap; }
.navbar-title:hover { text-decoration: none; opacity: 0.8; }
/* A document's logo, before its title: sized to the title's line and centred on it. */
.navbar-title { display: inline-flex; align-items: center; gap: 9px; }
#devpage-nav .document-title { display: flex; align-items: center; gap: 9px; }
.navbar-title .logo { width: 22px; height: 22px; flex: none; }
#devpage-nav .document-title .logo { width: 20px; height: 20px; flex: none; }
.navbar-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.navbar-link, .navbar-entry {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--muted); font: 500 14px/1.2 var(--font); white-space: nowrap;
  background: none; border: 0; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.navbar-link:hover, .navbar-entry:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.navbar-link.current, .navbar-menu.current > .navbar-link { color: var(--text); font-weight: 600; }
.navbar-link.icon-only { padding: 6px; }
.icon { width: 16px; height: 16px; flex: none; }
.navbar-link .icon:last-child:not(:first-child) { width: 13px; height: 13px; opacity: 0.6; transition: transform 0.2s; }
.navbar-menu { position: relative; }
.navbar-menu.open > .navbar-link .icon:last-child:not(:first-child) { transform: rotate(180deg); }
.navbar-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; padding: 6px;
  background: var(--background); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--text) 30%, transparent);
}
.navbar-menu.open .navbar-dropdown { display: grid; gap: 2px; }
.navbar-entry { color: var(--text); padding: 8px 10px; }
.navbar-entry .icon { color: var(--muted); }
.navbar-entry.current { background: var(--surface); font-weight: 600; }
.navbar-end { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--border); height: 24px; }

body.with-navbar #devpage-nav { top: 52px; height: calc(100vh - 52px); }
body.with-navbar #devpage-nav .resize { top: 52px; }

/* The theme selector: one quiet icon button, the size of the navbar's icons,
   showing the theme a click switches to — a moon in light, a sun in dark. In
   the navbar when a site has one, else in the top-right corner. Never printed;
   a deck hides it in fullscreen. */

.theme-toggle, .comment-mode, .design-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover, .comment-mode:hover { color: var(--text); background: var(--surface); }
/* An embed's own switch sits on the backdrop, which is the surface. */
.design-theme:hover { background: var(--background); }
.design-theme[hidden] { display: none; }
/* Comment mode, pressed: the accent, on a tint of it. */
.comment-mode[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
#devpage-corner { display: flex; gap: 4px; }
.theme-toggle span, .design-theme span { display: inline-flex; }
.theme-toggle .to-light, :root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline-flex; }
/* An embed's switch shows the theme a click turns it to: its own theme's
   once turned, else the page's. */
.design-theme .to-light, :root[data-theme="dark"] .design-theme .to-dark, .design-embed[data-theme="dark"] .design-theme .to-dark { display: none; }
:root[data-theme="dark"] .design-theme .to-light, .design-embed[data-theme="dark"] .design-theme .to-light { display: inline-flex; }
.design-embed[data-theme="light"] .design-theme .to-dark { display: inline-flex; }
.design-embed[data-theme="light"] .design-theme .to-light { display: none; }
#devpage-corner { position: fixed; top: 14px; right: 16px; z-index: 15; }
:root:fullscreen #devpage-corner, .print #devpage-corner { display: none; }
@media print { #devpage-navbar, #devpage-corner { display: none !important; } body.with-navbar #devpage-nav { top: 0; } }

/* Steps: numbered steps joined by a line, each a title, a body and commands. */
.steps { list-style: none; margin: 1.5rem 0 20px; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: 1rem; padding-bottom: 1.75rem; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: calc(1rem - 1px); top: 2.5rem; bottom: 0.5rem; width: 2px; border-radius: 1px; background: var(--border); }
.step:last-child::before { display: none; }
.step-number { width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--background)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.step-content { min-width: 0; padding-top: 0.2rem; }
.step-title { font-weight: 600; font-size: 1.05rem; line-height: 1.6; }
.step-content > p { margin: 0.2rem 0 0; }
.step-block > :first-child { margin-top: 0.6rem; }
.step-block > :last-child { margin-bottom: 0; }
.step-commands { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; margin-top: 0.6rem; max-width: 100%; }
.step-command { display: block; max-width: 100%; overflow-x: auto; white-space: pre; font: 0.85rem/1.5 var(--font-mono); padding: 0.4rem 0.8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.step-prompt { color: var(--muted); margin-right: 0.6rem; user-select: none; }

/* Cards: a grid of link cards, each an optional icon, a title and a summary. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.5rem 0 20px; }
@media (max-width: 700px) { .cards.cards-fixed { grid-template-columns: minmax(0, 1fr) !important; } }
.card { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; padding: 1.1rem 1.25rem 1.2rem; border: 1px solid var(--border); border-radius: 14px; background: var(--background); color: inherit; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
a.card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 12px 28px -16px color-mix(in srgb, var(--text) 40%, transparent); }
.card-icon { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin-bottom: 0.45rem; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--background)); }
.card-icon .icon { width: 1.2rem; height: 1.2rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 1.05rem; font-weight: 600; color: var(--text); }
.card-arrow { color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity 0.2s ease, transform 0.2s ease; }
a.card:hover .card-arrow { opacity: 1; transform: none; }
.card-summary { font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
@media print { .card, .step { break-inside: avoid; } .card-arrow { display: none; } a.card { transform: none; box-shadow: none; } }

/* A part's requirements: one row each, its status first. */
.requirements { margin: 1.25rem 0 20px; }
.requirements-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.requirement { display: flex; align-items: baseline; gap: 0.9rem; padding: 0.7rem 1rem; color: var(--text); border-top: 1px solid var(--border); transition: background 0.15s ease; }
.requirement:first-child { border-top: 0; }
a.requirement:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 6%, var(--background)); }
.requirement-status { flex: none; width: 6.4rem; padding: 0.12rem 0; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-align: center; white-space: nowrap; color: var(--muted); background: var(--surface); }
.requirement-status.status-met { color: #1a7f37; background: color-mix(in srgb, #1a7f37 12%, var(--background)); }
.requirement-status.status-not-met { color: #cf222e; background: color-mix(in srgb, #cf222e 12%, var(--background)); }
.requirement-status.status-no-test { color: #9a6700; background: color-mix(in srgb, #9a6700 14%, var(--background)); }
.requirement-title { min-width: 0; }
.requirements-above { margin-top: 0.75rem; }
.requirements-above summary { cursor: pointer; padding: 0.3rem 0.2rem; color: var(--muted); font-size: 0.92rem; }
.requirements-above[open] summary { margin-bottom: 0.4rem; }
.requirements-checked, .requirements-none { margin: 0.6rem 0.2rem 0; color: var(--muted); font-size: 0.85rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .requirement-status.status-met { color: #3fb950; }
  :root:not([data-theme]) .requirement-status.status-not-met { color: #ff7b72; }
  :root:not([data-theme]) .requirement-status.status-no-test { color: #d29922; }
}
:root[data-theme="dark"] .requirement-status.status-met { color: #3fb950; }
:root[data-theme="dark"] .requirement-status.status-not-met { color: #ff7b72; }
:root[data-theme="dark"] .requirement-status.status-no-test { color: #d29922; }
@media print { .requirement { break-inside: avoid; } .requirements-above > .requirements-list { display: block; } }

/* A published document's versions: the menu and the download at the bottom
   left — the sidebar leaves room under its last link for them — and on an old
   version a strip across the top linking to the latest, in the page's flow
   like the navbar, so it covers nothing. */
#devpage-versions { position: fixed; left: 16px; bottom: 16px; z-index: 6; display: flex; gap: 8px; align-items: flex-end; font: 13px var(--font); }
#devpage-versions summary, .version-download { display: block; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 9px; cursor: pointer; text-decoration: none; list-style: none; }
#devpage-versions summary::-webkit-details-marker { display: none; }
.version-menu { position: relative; }
.version-menu ul { position: absolute; bottom: calc(100% + 4px); left: 0; margin: 0; padding: 6px 0; list-style: none; min-width: 260px; max-height: 50vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.version-menu li { padding: 3px 12px; white-space: nowrap; }
.version-menu li span { color: var(--muted); }
.version-menu a[aria-current] { font-weight: 600; }
body.with-versions #devpage-nav { padding-bottom: 72px; }
body.with-version-banner { flex-wrap: wrap; align-content: flex-start; }
#devpage-version-banner { flex: 0 0 100%; padding: 6px 64px; text-align: center; font: 13px var(--font); background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
:fullscreen #devpage-versions, :fullscreen #devpage-version-banner { display: none; }
@media print { #devpage-versions, #devpage-version-banner { display: none !important; } }

/* Places: a document's widgets outside its pages' text. The navbar's sit
   before the theme selector; the panel is the window's right edge, beside
   the page on a wide window — the page gives it the room, and the comment
   threads become the list a button opens — and over it on a narrow one and
   on a deck; the floating ones are at the middle of the bottom edge. Never
   printed; a deck hides them in fullscreen. */

#devpage-place-navbar, #devpage-place-navbar .placed, #devpage-place-navbar .placed > [data-widget] { display: flex; align-items: center; gap: 4px; }
#devpage-place-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: 300px;
  display: none; overflow: auto; padding: 16px;
  background: var(--background); border-left: 1px solid var(--border);
  font-size: 14px; line-height: 1.45;
}
body.with-panel #devpage-place-panel { display: block; }
body.panel-beside { padding-right: 300px; }
body.panel-beside #devpage-corner { right: 316px; }
body.panel-beside #devpage-comments-toggle { right: 316px; }
body.panel-beside #devpage-comments:not(.beside) { right: 300px; }
#devpage-place-float {
  position: fixed; left: 50%; bottom: 16px; z-index: 22; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
}
:fullscreen #devpage-place-panel, :fullscreen #devpage-place-float { display: none; }
@media print { #devpage-place-navbar, #devpage-place-panel, #devpage-place-float { display: none !important; } body.panel-beside { padding-right: 0; } }

/* What a widget marked on the page (`page.mark`), and the block a pick would
   take while picking is on. */
mark.devpage-mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; }
body.picking #devpage-page [data-source] { cursor: crosshair; }
body.picking #devpage-page [data-source] :is(a, button, summary) { cursor: pointer; }
.devpage-pick { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* A workspace allocates the viewport to the tool, which owns its toolbar and inspector. */
body.devpage-workspace {height:100dvh;overflow:hidden;display:flex;flex-direction:column;flex-wrap:nowrap;align-content:normal;}
body.devpage-workspace > #devpage-page {flex:1;min-width:0;min-height:0;width:100%;max-width:none;margin:0;padding:0;overflow:hidden;}
body.devpage-workspace #devpage-page > [data-widget] {width:100%;height:100%;min-height:0;margin:0;}

/* A phone or a narrow window: the page comes first. The navigator — the
   navbar's links, then the sidebar, or a doc's outline — slides in over it
   from the one toggle at the top left, and goes when a link in it is
   followed, the page beside it is touched or Escape is pressed. On a wide
   screen the wrapper lays out as if it weren't there. Type, code and tables
   take the narrow width. Screens only: a printed page is as narrow, and
   prints as the wide layout does. Last in the sheet, so it wins over the
   rules it narrows. */
#devpage-navigator { display: contents; }
.navigator-links, .nav-toggle { display: none; }
@media screen and (max-width: 860px) {
  body { display: block; }
  #devpage-navigator, #devpage-nav.navigator {
    display: block;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    width: min(86vw, 340px); height: auto; align-self: stretch;
    overflow-y: auto; overscroll-behavior: contain;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    border-right: 1px solid var(--border);
    background: var(--surface);
    font-size: 16px; line-height: 1.4;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.28s;
  }
  body.nav-open #devpage-navigator, body.nav-open #devpage-nav.navigator {
    transform: none; visibility: visible; transition-delay: 0s;
    box-shadow: 0 0 40px color-mix(in srgb, #000 22%, transparent);
  }
  /* The sidebar inside it is one more block of the navigator. */
  #devpage-navigator #devpage-nav {
    position: static; width: auto; height: auto; overflow: visible;
    padding: 0; border: 0; background: none; font-size: inherit;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open::before { content: ""; position: fixed; inset: 0; z-index: 39; background: color-mix(in srgb, #000 30%, transparent); }
  #devpage-nav .resize { display: none; }
  #devpage-nav a { padding: 7px 10px; }
  #devpage-nav .chevron { width: 36px; height: 36px; }
  #devpage-nav .search input { height: 40px; font-size: 16px; }
  #devpage-nav .search kbd { display: none; }

  /* The navbar's links leave the bar for the navigator's top, each
     dropdown's entries listed under its label. */
  #devpage-navbar .navbar-links { display: none; }
  .navbar-inner { padding: 0 8px 0 12px; gap: 8px; }
  .navbar-end { margin-left: auto; border-left: 0; padding-left: 0; }
  .navigator-links { display: grid; gap: 2px; margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
  .navigator-links .navbar-link, .navigator-links .navbar-entry { display: flex; font-size: 16px; padding: 9px 10px; color: var(--text); white-space: normal; }
  .navigator-links .navbar-link.current, .navigator-links .navbar-entry.current { background: var(--border); font-weight: 600; }
  .navigator-links .navbar-link.icon-only::after { content: attr(title); }
  .navigator-links .navbar-menu > .navbar-link { width: 100%; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; pointer-events: none; padding-bottom: 4px; }
  .navigator-links .navbar-menu > .navbar-link .icon { display: none; }
  .navigator-links .navbar-dropdown { display: grid; gap: 2px; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; background: none; }

  body:has(.navigator) .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
    background: none; color: var(--text); cursor: pointer;
  }
  /* With no navbar, the corner becomes a bar across the top that holds the
     toggle at its start and the page's controls at its end. */
  body:not(.with-navbar):has(.navigator) #devpage-corner {
    top: 0; left: 0; right: 0; height: 52px; padding: 0 12px;
    align-items: center;
    background: color-mix(in srgb, var(--background) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
  }
  body:not(.with-navbar):has(.navigator) #devpage-corner > .nav-toggle { margin-right: auto; }
  body:not(.with-navbar):has(.navigator) main { padding-top: 76px; }

  main { padding: 24px 16px 72px; }
  #devpage-place-panel { width: 100vw; border-left: 0; }
  h1 { font-size: 32px; margin-bottom: 18px; }
  h2 { font-size: 24px; margin: 40px 0 14px; }
  h3 { font-size: 19px; margin: 28px 0 10px; }
  pre { padding: 12px 14px; border-radius: 8px; }
  pre code { font-size: 13px; }
  table { font-size: 14px; }
  th, td { padding: 8px 10px; }
  /* A cell's code stays whole: the table scrolls in its box instead. */
  td code, th code { white-space: nowrap; }
  /* A diagram keeps a size its text can be read at, and scrolls in its box. */
  article .diagram { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
  article .diagram svg { display: block; margin: 0 auto; max-width: none !important; }
  .code-hero { margin-bottom: 28px; }
  .code-eyebrow { font-size: 15px; }
  .code-hero h1 { font-size: 34px; }
  .code-hero p:not(.code-eyebrow) { font-size: 19px; }
  .code-declaration pre { padding: 14px 16px; border-radius: 12px; }
  .code-declaration pre code { font-size: 13px; }
  .code-source { margin-bottom: 28px; }
  .code-topics h3 { font-size: 20px; margin-top: 40px; }
  .code-topic a code { font-size: 14px; }
}