charset: include gsm0338 in legacy group
[sheet.git] / style / _base.scss
1 /* general */
2
3 body, .s-dark .s-light {
4         background: #FFF;
5         color: #000;
6         font-size: 90%;
7         text-align: center;
8 }
9 a, a:visited {
10         color: #000;
11         text-decoration: underline;
12 }
13 a:active, a:hover {
14         color: #00F;
15         text-decoration: none;
16 }
17
18 /* common sections */
19
20 h1, h2 {
21         font-size: 200%;
22         margin: 0;
23 }
24 h2, caption {
25         font-size: 110%;
26         font-weight: bold;
27 }
28 caption {
29         margin: 1ex;
30
31         aside {
32                 position: absolute;
33                 margin-left: 1ex;
34                 font-weight: normal;
35                 display: inline;
36                 font-size: 91%; /* 100% */
37                 margin-top: .3ex; /* align with 110% baseline */
38         }
39 }
40
41 hr {
42         clear: both;
43         visibility: hidden;
44         height: 2ex;
45         margin: 0;
46 }
47
48 .section {
49         ul {
50                 margin-bottom: 1ex;
51         }
52         h2 {
53                 margin: 0 1ex;
54                 clear: both;
55         }
56         table {
57                 float: left;
58                 position: relative; /* prevents buggy hovering in table if caption present in gecko */
59                 margin: 1ex 1ex 2ex;
60         }
61         .section {
62                 float: left;
63         }
64         #charset & table {
65                 margin: -0.5ex 0 1ex; /* headers provide sufficient spacing already */
66         }
67 }
68
69 p {
70         margin: 1ex 0 1em;
71 }
72 p.aside {
73         font-size: 80%;
74 }
75 p.footer {
76         margin: 1em 0 0;
77         clear: both;
78 }
79 .help + .footer {
80         margin: 0;
81 }
82
83 .error {
84         background: #F00;
85         background: rgba(255, 0, 0, .8);
86         color: #FFF;
87         border: 2px solid #000;
88         border-width: 2px 0;
89         padding: 1em;
90         margin: 2ex auto;
91         clear: both;
92
93         > * {
94                 margin-bottom: 1ex;
95         }
96         > *:last-child {
97                 margin-bottom: 0;
98         }
99 }
100
101 ul {
102         margin: 0;
103         padding: 0;
104         list-style: none;
105 }
106
107 pre {
108         text-align: left;
109         margin: 2ex auto;
110         white-space: pre-wrap;
111         overflow-wrap: break-word;
112
113         body > & {
114                 width: 78ch;
115                 tab-size: 4;
116                 -moz-tab-size: 4;
117                 padding: 0 1em;
118                 border-width: 0 1px;
119                 border-style: solid;
120                 white-space: pre;
121                 font-size: 1.9vmin; /* cover full width at most */
122         }
123 }
124 code {
125         white-space: nowrap;
126 }
127
128 h1 small,
129 h2 small {
130         position: absolute; /* side note; do not influence alignment */
131         margin-left: 1em;
132         font-weight: normal;
133         font-size: 50%; /* 1rem */
134         padding-top: 1.75ex; /* align baseline with container */
135 }
136 h2 small {
137         font-size: 90.9%;
138         padding-top: .17ex;
139 }
140
141 .section dl {
142         display: grid;
143         grid: auto-flow / 1fr 1fr;
144         clear: both;
145
146         & > dt {
147                 grid-column: 1;
148                 text-align: right;
149         }
150 }
151 dt code {
152         white-space: normal;
153 }
154 dl > dd {
155         grid-column: 2;
156         text-align: left;
157         padding-left: 1em;
158         margin: 0 0 .5ex;
159 }
160 @media (max-width: 42em) {
161         .section dl {
162                 grid: auto-flow / minmax(8em, 1fr) minmax(10em, 3fr);
163         }
164         dl > dd {
165                 margin-bottom: 1ex; /* distinguish rows more as dts can wrap */
166         }
167         dd small {
168                 display: inline-block;
169         }
170         dd code {
171                 white-space: normal;
172         }
173 }
174
175 /* "keyboard" (list of keys) */
176
177 .row0 {margin-top: -5ex} /* top (esc) row fits besides header */
178 .row2 {margin-left: 7em} /* row offsets relative to ~6em key width */
179 .row3 {margin-left: 8em}
180 .row4 {margin-left: 10em} /* should actually align to next key on row1 */
181         /* ...however rows>=1 are shifted a bit, to make space */
182
183 h3 {
184         display: none; /* semantic details (non-css/js) */
185 }
186
187 .keys {
188         @at-root #{selector-unify(table, &)} {
189                 display: block;
190                 border-spacing: 0;
191                 border-collapse: collapse;
192                 white-space: nowrap;
193                 text-align: left;
194
195                 tr {
196                         clear: both; /* start new row (screen row) */
197                         display: block;
198                 }
199                 tbody {
200                         /* start new row block (keyboard row) */
201                         clear: both;
202                         padding-top: 1ex;
203                         display: block;
204                 }
205                 th {
206                         @extend h3;
207                 }
208         }
209
210         /* individual keys */
211
212         .mode {
213                 @extend h3; /* initially hidden (only show interactively (js)) */
214         }
215         @at-root {
216                 dl.legend dt,
217                 & td {
218                         display: inline-block;
219                         white-space: normal;
220                         width: 6.2em;
221                         line-height: 2.25ex; /* a little terser (seems to be gecko's default anyway) */
222                         height: 4.5ex; /* 2 lines */
223                         overflow: hidden;
224                         margin: 0 2px -1px;
225                         padding: 0;
226                         text-align: center;
227                         border: 1px solid #000;
228                         border-radius: 4px;
229                         -moz-border-radius: 4px;
230                         text-transform-variation: text;
231                 }
232         }
233         td b {
234                 float: left;
235                 font-size: 200%;
236                 line-height: 2.5ex; /* inherits otherwise */
237                 padding-left: 2px;
238         }
239         .row0 td { /* omni-present esc */
240                 width: 8.5em;
241         }
242
243         /* fine tuning of special occurrences */
244
245         td b[title] { /* mnemonic hover */
246                 cursor: help;
247         }
248         td[onclick]:hover { /* link */
249                 cursor: pointer;
250         }
251         td a { /* key link */
252                 color: inherit;
253                 text-decoration: none;
254                 display: block;
255                 height: 100%;
256         }
257
258         .meta, .ctrl, .lead {
259                 td b { /* char with ctrl or leading key */
260                         font-size: 100%; /* space is too limited for 2+ double-sized chars */
261                         line-height: 5ex; /* keep double height though */
262                 }
263         }
264         .meta, .ctrl {
265                 td b small { /* meta key indicator */
266                         font-size: 70%;
267                         font-weight: normal; /* nice and subtle */
268                 }
269         }
270
271         /* enlarged keys */
272
273         &.big {
274                 td {
275                         width: 1em;
276                         min-width: auto;
277                         height: 2.25ex;
278                         font-size: 200%;
279                         font-size: calc(7vmin - 4px); /* fit 12 keys to page */
280                         overflow: visible;
281                         position: relative;
282                         padding: 0;
283                         margin: 0 .2vw -1px;
284                 }
285
286                 /* override row alignments */
287                 tbody {
288                         font-size: calc(1.4vmin); /* enlarged td conversion */
289                 }
290                 .row2 {margin-left: 7em}
291                 .row3 {margin-left: 8em}
292                 .row4 {margin-left: 10em}
293                 .row0 {
294                         display: none; /* headerless */
295                 }
296
297                 td b {
298                         position: absolute; /* overlay */
299                         z-index: 1;
300                         top: -1.2ex; /* halfway over shift */
301                         left: 0;
302                         right: 0;
303                         font-size: 50%;
304                         opacity: .5;
305                         color: #FFF;
306                         line-height: 2.25ex;
307                 }
308                 &.cmp, .ctrl, .meta, .shift {
309                         td b {
310                                 display: none;
311                         }
312                 }
313         }
314 }
315
316 /* tables */
317
318 table {
319         border-collapse: collapse;
320 }
321 th, td {
322         border-color: #778;
323         border: 1px solid #888;
324         background: #DDD;
325 }
326 thead th, td {
327         text-align: center;
328 }
329
330 td.joind {
331         border-bottom: none;
332 }
333 td.joinu {
334         /* first cell determines border width for entire row */
335         border-top-color: transparent;
336 }
337 td.joinr {
338         border-right: none;
339 }
340 td.joinl {
341         border-left: none;
342 }
343
344 thead {
345         position: sticky;
346         top: 0;
347         background: #DDD8;
348 }
349
350 /* character table */
351
352 .glyphs {
353         thead th, td {
354                 width: 1.6em; /* regular interval */
355         }
356         tbody td {
357                 font-size: 112%;
358         }
359         &.big tbody td {
360                 font-size: 200%;
361         }
362         & & {
363                 margin: 0.5ex 0; /* nested in legend */
364                 td {
365                         font-size: 100%;
366                 }
367         }
368 }
369
370 .cover td {
371         min-width: 2.5ex; /* square cells */
372 }
373
374 /* table headers */
375
376 th,
377 tfoot td,
378 thead td {
379         border-width: 0;
380         background: transparent;
381 }
382 .glyphs thead td {
383         width: auto; /* no glyph cells in header */
384 }
385 .glyphs caption {
386         margin-left: 2.2em; /* 1ex + offset head column (1.6em + 0.4em) / 110% */
387                 /* adjusted insignificant -.2em to fit wide contents on /charset/mac */
388 }
389 th {
390         padding: 0 0.2em;
391 }
392 .diinfo th {
393         font-size: 50%; /* mostly insignificant here */
394         font-weight: normal;
395 }
396 .diinfo tbody th {
397         text-align: right; /* variable width so keep near cells */
398         padding: 0 0.5em;
399 }
400 .cat {
401         font-size: 70%;
402         text-transform: uppercase;
403 }
404 tfoot .cat th {
405         border-top: 1px solid #888;
406 }
407
408 /* colour map */
409
410 table.color {
411         td {
412                 & {
413                         border: 1px solid #555;
414                         font-weight: normal;
415                         padding: 0 8px;
416                 }
417                 samp {
418                         margin: 0 -8px 0 8px;
419                         font-family: inherit;
420                         float: right;
421                 }
422                 samp ~ samp {
423                 }
424                 samp small {
425                         font: 100% monospace;
426                         padding: 0 .5ex;
427                 }
428         }
429 }
430
431 /* digraphs map */
432
433 table.dimap {
434         table-layout: fixed; /* prevent resizing, notably in msie6 */
435 }
436 .dimap {
437         thead th, td {
438                 /* below-maximum size (but still average enough to be regular) so we can fit more */
439                 width: 1.2em; /* msie only looks at the first row */
440                 min-width: 1em; /* prevents gecko from restricting to page width */
441         }
442         th {
443                 text-align: center; /* row headers are also glyph-sized */
444         }
445 }
446
447 .mapped,
448 .dimap {
449         tbody, colgroup {
450                 border: 2px double #888; /* major character group grid */
451         }
452         tbody {
453                 border-width: 2px 0; /* horizontal group dividers */
454         }
455         colgroup {
456                 border-width: 0 2px; /* vertical divides */
457         }
458 }
459
460 /* digraph selection */
461
462 .diinfo {
463         -moz-column-width: 24em;
464         -webkit-column-width: 24em;
465         column-width: 24em;
466
467         & > div {
468                 overflow: hidden;
469                 column-break-inside: avoid;
470                 -webkit-column-break-inside: avoid;
471                 position: relative; z-index: 1; /* webkit bug */
472         }
473 }
474
475 /* glyph cell overlay (digraph labels) */
476
477 .glyphs.dilabel {
478         td {
479                 padding: 0;
480                 padding-bottom: 1.1ex; /* reserve space for label */
481                 vertical-align: bottom;
482         }
483         small {
484                 font-size: 50%;
485                 display: block;
486                 margin-top: 0.2ex;
487                 margin-bottom: -2.2ex; /* take cell padding */
488         }
489         small.digraph {
490                 background: #000;
491                 color: #FFF;
492                 opacity: 0.3;
493         }
494         small.value {
495                 background: #600;
496                 color: #FFF;
497                 opacity: 0.3;
498         }
499 }
500
501 /* character properties */
502
503 .X  {background: #FFF} /* unidentified */
504 .Mc, .Me, .Zl, .Zp      {background: #F00} /* unstyled */
505 .X > span               {background: #898; background: rgba(0, 0, 0, .25)} /* invisible contents */
506
507 /* letter scripts */
508 .Armenian,
509 .Greek    {background: #FFE8CF}
510 .Cyrillic {background: #FFDDA8}
511 .Latin    {background: #FFB}
512 .Aramaic,
513 .Hebrew   {background: #FFD}
514 .Arabic   {background: #EFE}
515 .African  {background: #DED}
516 .Brahmic  {background: #FBB} /* same as number */
517 .Khmer    {background: #FBA}
518 .Hangul,
519 .Syllabic {background: #DEA}
520 .Katakana {background: #DFA}
521 .Hiragana {background: #DFC}
522 .Bopomofo {background: #BFC}
523 .Han      {background: #CFD}
524 .Alpha    {background: #ADA} /* other scripts */
525
526 /* other categories */
527 .Nd, .Nl, .No         {background: #FDD} /* number */
528 .Sc                   {background: #FCD} /* currency */
529 .Sm                   {background: #ECE} /* math */
530 .So                   {background: #DCF} /* symbol */
531 .Pd, .Po, .Pc         {background: #CDF} /* punctuation */
532 .Ps, .Pe, .Pi, .Pf    {background: #BEF} /* quote */
533 .Lm, .Sk              {background: #CEE} /* spacing modifier */
534 .Mn                   {background: #ACC} /* modifier */
535 .Cc, .Cf {color: #666; background: #BBB} /* control */
536 .Zs                   {background: #ACB} /* space */
537 .Co, .Xi.Co           {background: #DCC} /* private */
538 .Xi, .Cs              {background: #CCC} /* invalid */
539 .Xd                   {color: #844} /* deprecated */
540 .Xr                   {color: #888} /* reserved (digraph reverse or proposal) */
541 .dimap .Xr            {background: #EEE} /* reversed digraph */
542 .ccmap .Xr {opacity:.4}
543
544 /* support levels */
545 .l1 {background: #FDD} /* no, unsupported, other */
546 .l2 {background: #FED} /* partial, restricted, unofficial */
547         /* default u-prop, u-bmp */
548 .l3 {background: #FFD} /* almost, imperfect, common */
549         /* default u-di, u-lat1 */
550 .l4 {background: #EFD} /* yes, supported, ubiquitous, native */
551         /* default u-ascii */
552 .l5 {background: #DFD} /* complete, perfect */
553 .l0 {background: #EEE} /* unknown, omitted */
554 .ex {     color: #888; color: rgba(0, 0, 0, .5)} /* experimental, disfavoured */
555 .u-invalid {background: #BBB} /* invalid, impossible */
556
557 /* foreground representation */
558 #digraphs {
559         .u-l4 {color: #080} /* partial */
560         .u-l5 {color: #4C0} /* experimental */
561         .u-l2 {color: #A44; color: rgba(128, 0, 0, .6)} /* unofficial */
562         .u-l1 {color: #D00; color: rgba(255, 0, 0, .8)} /* missing */
563 }
564
565 /* support percentage (browser cells) */
566 .p0         {opacity: .6}
567 .p0.p       {opacity: 1}
568 .p::after   {content: '!'; color: #F00}
569 .p4::after  {color: #C00}
570 .p3::after  {color: #A00}
571 .p2::after  {color: #800}
572 .p1::after,
573 .p0::after  {color: #000}
574 .p09::after {opacity: .9}
575 .p08::after {opacity: .8}
576 .p07::after {opacity: .7}
577 .p06::after {opacity: .6}
578 .p05::after {opacity: .5}
579 .p04::after {opacity: .4}
580 .p03::after {opacity: .3}
581 .p02::after {opacity: .2}
582 .p01::after {opacity: .1}
583 .p00::after {display: none}
584
585 /* code syntax */
586 .sy-comment    { color: #888 }
587 .sy-constant   { color: #008 }
588 .sy-identifier { color: #804 }
589 .sy-statement  { }
590 .sy-preProc    { }
591 .sy-type,
592 .sy-special    { color: #408 }
593 .sy-error      { font-weight: bold; background-color: #F00; color: #FFF }
594 .sy-todo       { background-color: #FF0 }
595
596 /* boolean alternate */
597 .glyphs b      { font-weight: normal; color: #800 }
598
599 /* hover effects */
600 .X:hover {cursor: help}
601 body { // precedence in dark
602 .X:hover > span                            {background: #FFF} /* whitespace marker */
603 .Greek:hover, .Armenian:hover              {background: #FA8}
604 .Cyrillic:hover                            {background: #FB7}
605 .Latin:hover                               {background: #EE4}
606 .Hebrew:hover, .Aramaic:hover              {background: #FFA}
607 .Arabic:hover                              {background: #CFD}
608 .African:hover                             {background: #BDB}
609 .Syllabic:hover, .Hangul:hover             {background: #CE6}
610 .Katakana:hover                            {background: #BF7}
611 .Hiragana:hover                            {background: #AF8}
612 .Bopomofo:hover                            {background: #8FA}
613 .Brahmic:hover                             {background: #F77}
614 .Khmer:hover                               {background: #F87}
615 .Han:hover                                 {background: #5EB}
616 .Alpha:hover                               {background: #5C5}
617 .Nd:hover, .Nl:hover, .No:hover            {background: #F99} /* number */
618 .Sc:hover                                  {background: #F8C} /* currency */
619 .Sm:hover                                  {background: #F8F} /* math */
620 .So:hover                                  {background: #A8F} /* symbol */
621 .Pd:hover, .Po:hover, .Pc:hover            {background: #8AF} /* punctuation */
622 .Ps:hover, .Pe:hover, .Pi:hover, .Pf:hover {background: #8DF} /* quote */
623 .Lm:hover, .Sk:hover                       {background: #BFF} /* spacing modifier */
624 .Mn:hover                                  {background: #CDE} /* modifier */
625 .Zs:hover                                  {background: #CED} /* space */
626 .Cc:hover, .Cf:hover                       {background: #DDD} /* control */
627 .Co:hover                                  {background: #A77} /* private */
628 .Xr:hover                                  {background: #FFF} /* reserved */
629 .Xi:hover                                  {background: #DDD} /* invalid */
630 .l0:hover                                  {background: #888}
631 .l1:hover                                  {background: #F88}
632 .l2:hover                                  {background: #FC8}
633 .l3:hover                                  {background: #FF8}
634 .l4:hover                                  {background: #CF8}
635 .l5:hover                                  {background: #8F8}
636 }
637 .u-l4:hover    {outline: 1px solid #080}
638 .u-l5:hover    {outline: 1px solid #8F0}
639 .u-l2:hover    {outline: 1px solid #800}
640 .u-l1:hover    {outline: 1px solid #F00}
641
642 /* key type colorization */
643
644 .c-sa,
645 .g1 {background: #BFE} /* cyan: info */
646 .c-na,
647 .g2 {background: #BFB} /* green: motion */
648 .g3 {background: #DFA} /* greenish: jump (g2+) */
649 .c-af,
650 .g4 {background: #FFA} /* yellow: command */
651 .c-eu,
652 .g5 {background: #FDA} /* orangish: open (g6-) */
653 .g6 {background: #FCA} /* orange: insert */
654 .c-as,
655 .g7 {background: #FCC} /* red: mode */
656 .c-an,
657 .g8 {background: #ECE} /* purple: visual (g7+) */
658 .c-oc,
659 .g9 {background: #CCF} /* blue: prefix */
660
661 .c-sa:hover,
662 .g1 a:hover, .g1[onclick]:hover {background: #5ED}
663 .c-na:hover,
664 .g2 a:hover, .g2[onclick]:hover {background: #7E7}
665 .g3 a:hover, .g3[onclick]:hover {background: #CE6}
666 .c-af:hover,
667 .g4 a:hover, .g4[onclick]:hover {background: #EE4}
668 .c-eu:hover,
669 .g5 a:hover, .g5[onclick]:hover {background: #FA6}
670 .g6 a:hover, .g6[onclick]:hover {background: #F97}
671 .c-as:hover,
672 .g7 a:hover, .g7[onclick]:hover {background: #F88}
673 .c-an:hover,
674 .g8 a:hover, .g8[onclick]:hover {background: #D9D}
675 .c-oc:hover,
676 .g9 a:hover, .g9[onclick]:hover {background: #99F}
677
678 .no {
679         background: #EEE; /* unassigned */
680 }
681 .keys td.ni {
682         border: 0;
683         padding: 1px; /* same size as borderlessless keys */
684         background: none;
685 }
686
687 dl.legend dt.more,
688 .keys td.more {
689         outline: 3px solid #0006;
690         outline-offset: -3px; /* inside */
691 }
692 dl.legend dt.new,
693 .keys td.new {
694         border-style: dashed;
695 }
696 .ext,
697 dl.legend dt.ext,
698 .keys td.ext {
699         opacity: .6;
700 }
701
702 /* l/r help columns */
703
704 .help {
705         display: table;
706         width: 100%;
707
708         & > * {
709                 display: table-cell;
710                 width: 20%;
711                 vertical-align: top;
712         }
713 }
714
715 .left {
716         dl.legend {
717                 & {
718                         margin-left: 6.4em; /* a bit over 6.2em to allow for borders+padding (border-sizing would work too) */
719                 }
720                 dt {
721                         margin-left: -6.4em; /* msie<=6 multiply this by two for some reason */
722                         float: left;
723                         clear: left;
724                 }
725                 dd {
726                         float: left; /* align next to dt (except msie<=7 does just the opposite) */
727                 }
728         }
729 }
730 .right {
731         dl.legend {
732                 & {
733                         margin-right: 6.4em;
734                 }
735                 dt {
736                         margin-right: -6.4em;
737                         float: right;
738                         clear: right;
739                 }
740                 dd {
741                         float: right;
742                 }
743         }
744         & {
745                 text-align: right;
746         }
747 }
748
749 /* help/legend */
750
751 dl.legend {
752         dt {
753                 margin: 0 0 1px; /* distinct keys */
754                 height: auto; /* not key-height */
755                 padding: 2px 0;
756         }
757         dd {
758                 margin: 3px 0.4em 0; /* align text (add dt border+padding height) */
759                 padding: 0;
760         }
761 }
762
763 dl.legend-options dt {
764         background: #CCC;
765 }
766
767 ul.legend-set {
768         clear: right;
769         padding-top: 1ex;
770
771         li {
772                 margin: 6px 0; /* similar to dl legends */
773         }
774 }
775
776 .legend {
777         margin-top: 1em;
778
779         table {
780                 width: 100%;
781         }
782         td {
783                 padding: 0 0.2em;
784         }
785 }
786
787 /* images */
788
789 figure {
790         margin: 0;
791         position: relative;
792
793         img {
794                 vertical-align: bottom;
795                 width: 100%;
796         }
797 }
798
799 @media (min-width: 60em) {
800         figcaption {
801                 padding: 0 1em;
802                 color: #000;
803                 background: rgba(255, 255, 255, .66);
804                 position: absolute;
805                 right: 0;
806                 bottom: 0;
807                 max-width: 100%;
808                 box-sizing: border-box;
809         }
810         .gallery li.parent:hover > figure > figcaption,
811         .gallery figure:hover > figcaption {
812                 /* highlight title of current and parents */
813                 font-size: 175%;
814                 right: 50%;
815                 bottom: 50%;
816                 transform: translate(50%, 50%);
817                 margin-left: -60%; /* keep width */
818         }
819 }
820
821 /* image gallery */
822
823 .gallery {
824         display: grid;
825         grid: auto-flow dense / repeat(auto-fit, minmax(200px, 1fr));
826         grid-gap: 1px;
827
828         li, ul {
829                 display: contents;
830         }
831         figure {
832                 overflow: hidden;
833                 box-sizing: border-box;
834                 hyphens: auto;
835                 max-width: 900px;
836         }
837         figcaption > small {
838                 display: inline-block;
839         }
840
841         @media (min-width: 403px) and (min-height: 266px) {
842                 /* able to fit 2 cells of 200x133 */
843                 li.large > figure {
844                         grid-row: span 2;
845                         grid-column: span 2;
846                 }
847         }
848         @media (min-width: 603px) and (min-height: 400px) {
849                 /* fit 3 cells of 200x133 */
850                 > li:first-child > figure,
851                 li.huge > figure {
852                         grid-row: span 3;
853                         grid-column: span 3;
854                 }
855         }
856
857         figure, figcaption {
858                 transition: all .5s ease-in;
859         }
860         figure:hover ~ ul figcaption {
861                 /* mark all children */
862                 color: #FFF;
863                 background: rgba(0, 0, 0, .5);
864         }
865
866         $oversup: 'figure[data-sup]:after'; // select parent overlays
867         #{$oversup} {
868                 position: absolute;
869                 right: 0;
870                 content: attr(data-sup);
871                 color: #FFF;
872                 background: #0006;
873                 border-radius: 1em;
874                 padding: .1ex .4em;
875                 margin: .4em;
876         }
877         .expand > #{$oversup} {
878                 content: '+' attr(data-sup);
879                 background: #0008;
880                 font-size: 150%;
881                 border: 2px solid #FFF8;
882         }
883 }
884
885 /* specialised galleries */
886
887 body#word {
888         margin: 8px 1px;
889 }
890
891 table.gallery {
892         & {
893                 grid-auto-flow: row;
894                 grid-template-columns: repeat(auto-fit, minmax(2em, max-content)); /* 1fr */
895         }
896         tbody,
897         tr {
898                 display: contents;
899         }
900         tr > :first-child {
901                 grid-column: 1;
902                 -grid-row: span 6;
903                 margin: auto; /* vertical-align: middle */
904         }
905         tr > :nth-child(2) {
906                 grid-column: 2; /* in case 1st is missing */
907         }
908         td {
909                 border: 0; /* does not collapse */
910                 outline: 1px solid #888; /* over grid-gap */
911         }
912 }
913
914 /* page-specific */
915
916 #browser {
917         td > a {
918                 text-decoration: none;
919         }
920         td > a:active,
921         td > a:hover {
922                 text-decoration: underline;
923         }
924         tr .aside {
925                 font-size: 80%;
926                 overflow: hidden;
927                 height: 0;
928                 -webkit-transition: all 1s ease-in;
929                 -o-transition: all 1s ease-in;
930                 -moz-transition: all 1s ease-in;
931                 transition: height 1s ease-in;
932
933                 p {
934                         margin: 1ex 0;
935                 }
936         }
937         tr.target, tr:target {
938                 .aside {
939                         height: auto;
940                 }
941         }
942         td.X {
943                 white-space: nowrap; /* some browsers break on dashes */
944         }
945
946         tr:target, tr.focus {
947                 & > td:first-of-type {
948                         background: inherit;
949                 }
950         }
951         tr.focus > td {
952                 border-bottom-color: #000;
953         }
954 }
955
956 form.aside {
957         position: absolute;
958         top: 3ex;
959         right: 1em;
960 }
961
962 .family-name {
963         font-variant: small-caps;
964 }
965
966 #index nav {
967         columns: 3;
968         -moz-columns: 3;
969         -webkit-columns: 3;
970 }
971 nav > .section {
972         break-inside: avoid;
973         -webkit-column-break-inside: avoid; /* webkit */
974         page-break-inside: avoid; /* moz */
975         overflow: hidden; /* webkit workaround */
976 }
977 #index nav a {
978         display: inline-block;
979         margin-top: 1em;
980 }
981
982 /* printing hints */
983
984 @page {
985         size: landscape;
986         margin: 0;
987 }
988
989 @media print {
990         ul.legend-set {display: none} /* current options only relevant on dynamic media */
991 }
992
993 /* terse optimisation */
994
995 @media (min-height: 112ex) and (min-width: 90em) {
996         .keys td {
997                 padding: 1ex 0 1ex .1em;
998                 width: 7em;
999         }
1000 }
1001
1002 @media (max-width: 79em) {
1003         .keys td {
1004                 position: relative; /* hides overflow */
1005                 width: 4.5em;
1006                 min-width: 6.5vw;
1007                 min-width: calc(7.7vw - 8px);
1008         }
1009         .keys td b,
1010         .keys .meta td b,
1011         .keys .ctrl td b,
1012         .keys .lead td b { /* leading chars always fit */
1013                 position: absolute; /* background */
1014                 right: 0; /* least overlap in corner */
1015                 font-size: 250%;
1016                 line-height: 2.5ex;
1017                 opacity: .5;
1018                 color: #FFF;
1019         }
1020
1021         .row2 {margin-left: 5.3em} /* 7em / Δtd(6em : 4.5em) */
1022         .row3 {margin-left: 6em}   /* 8em / Δtd */
1023         .row4 {margin-left: 7.5em} /* 10em / Δtd */
1024
1025         /* letter scripts columns to rows */
1026         .legend .glyphs {
1027                 &:first-child td {
1028                         display: table-row;
1029                         vertical-align: baseline;
1030                 }
1031                 td > table {
1032                         width: auto;
1033                         display: inline;
1034                         margin-left: 1ex;
1035                 }
1036                 &:first-child td td {
1037                         margin: 2px;
1038                         display: inline-block;
1039                         width: auto;
1040                 }
1041         }
1042
1043         @media (max-width: 61em) {
1044                 .keys td {
1045                         width: 3em;
1046                         height: 6.75ex; /* 3 lines */
1047                         font-size: 80%;
1048                 }
1049                 .keys td b,
1050                 .keys .meta td b,
1051                 .keys .ctrl td b,
1052                 .keys .lead td b {
1053                         line-height: 4ex;
1054                 }
1055
1056                 .row2 {margin-left: 3.5em} /* 7em / Δtd(6em : 3em) */
1057                 .row3 {margin-left: 4em}   /* 8em / Δtd */
1058                 .row4 {margin-left: 5em}   /* 10em / Δtd */
1059         }
1060
1061         @media (max-width: 42em) {
1062                 /* flatten right legend column on mobile */
1063                 .help > * {
1064                         display: table-row;
1065                         width: auto;
1066                 }
1067                 ul.legend-set {
1068                         clear: left;
1069                 }
1070                 .right dl.legend {
1071                         & {
1072                                 margin-right: 0;
1073                                 margin-left: 6.4em;
1074                         }
1075                         dt {
1076                                 margin-right: 0;
1077                                 margin-left: -6.4em;
1078                                 float: left;
1079                                 clear: left;
1080                         }
1081                         dd {
1082                                 float: left;
1083                         }
1084                 }
1085         }
1086 }
1087
1088 /*
1089 @media screen and (orientation: portrait) and (max-width: 62em) {
1090         body table.keys,
1091         #rows {
1092                 margin-top: 1ex;
1093                 transform: rotate(90deg);
1094                 transform-origin: top left;
1095                 margin-left: 40em;
1096                 margin-bottom: 30em;
1097                 font-size: 80%;
1098         }
1099 }
1100 */