File: urlbarView.css

package info (click to toggle)
firefox 147.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,324 kB
  • sloc: cpp: 7,607,156; javascript: 6,532,492; ansic: 3,775,158; python: 1,415,368; xml: 634,556; asm: 438,949; java: 186,241; sh: 62,751; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (1845 lines) | stat: -rw-r--r-- 59,606 bytes parent folder | download
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
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@import url("chrome://browser/skin/urlbar-dynamic-results.css");

@namespace html url("http://www.w3.org/1999/xhtml");

:root {
  --urlbarView-hover-background: var(--arrowpanel-dimmed);
  --urlbarView-separator-color: color-mix(in srgb, currentColor 14%, transparent);

  --urlbarView-highlight-background: SelectedItem;
  --urlbarView-highlight-color: SelectedItemText;

  --urlbarView-secondary-text-color: color-mix(in srgb, currentColor 73%, transparent);

  --urlbarView-action-color: LinkText;
  --urlbarView-action-slide-in-distance: 200px;

  --urlbarView-small-font-size: 0.85em;

  --urlbarView-results-padding: 7px;
  --urlbarView-row-gutter: 2px;
  --urlbarView-item-inline-padding: var(--urlbar-icon-padding);
  --urlbarView-item-block-padding: 6px;

  /* The inline margins of a row icon. Rows with different icon sizes will define
     different values for these variables so that the icons of all rows are
     center-aligned along one vertical axis. Row icons happen to use the
     `.urlbarView-favicon` class but not all icons are favicons (e.g., rich
     search suggestion icons are images from the search engine). */
  --urlbarView-icon-margin-start: 0px;
  --urlbarView-icon-margin-end: calc(var(--urlbar-icon-padding) + var(--identity-box-margin-inline));

  /* The size and inline margins of a standard 16px favicon. The margin variables
     can be used to align any 16px content along the vertical icon axis. */
  --urlbarView-favicon-width: 16px;
  --urlbarView-favicon-margin-start: var(--urlbarView-icon-margin-start);
  --urlbarView-favicon-margin-end: var(--urlbarView-icon-margin-end);

  --urlbarView-rich-suggestion-default-icon-size: 28px;
  --urlbarView-top-pick-large-icon-box-size: 52px;

  --urlbarView-result-button-size: 24px;
  --urlbarView-result-button-background-opacity: 60%;
  --urlbarView-result-button-selected-color: var(--toolbar-field-focus-color);
  --urlbarView-result-button-selected-background-color: color-mix(
    in srgb,
    var(--toolbar-field-focus-background-color) var(--urlbarView-result-button-background-opacity),
    transparent
  );
  --urlbarView-result-button-hover-color: var(--toolbar-field-focus-background-color);
  --urlbarView-result-button-hover-background-color: color-mix(
    in srgb,
    var(--toolbar-field-focus-color) var(--urlbarView-result-button-background-opacity),
    transparent
  );

  --urlbarView-labeled-row-margin-top: calc(1.46em + 4px);
  --urlbarView-labeled-row-label-top: calc(-1.27em - 2px);
  --urlbarView-labeled-tip-margin-top-extra: 8px;

  --urlbarView-action-button-background-color: color-mix(in srgb, var(--urlbarView-hover-background) 50%, transparent);
  --urlbarView-action-button-hover-background-color: var(--urlbarView-hover-background);

  &:-moz-locale-dir(rtl) {
    --urlbarView-action-slide-in-distance: -200px;
  }

  &[lwtheme] {
    --urlbarView-action-color: light-dark(rgb(91, 91, 102), rgb(191, 191, 201));
    --urlbarView-highlight-background: light-dark(rgb(0, 99, 255), rgb(0, 99, 225));
    --urlbarView-highlight-color: white;
  }

  @media (prefers-contrast) {
    --urlbarView-separator-color: color-mix(in srgb, currentColor 86%, transparent);
    --urlbarView-result-button-background-opacity: 100%;
    --urlbarView-secondary-text-color: currentColor;
  }

  /* stylelint-disable-next-line media-query-no-invalid */
  @media -moz-pref("browser.urlbar.richSuggestions.featureGate") {
    --urlbarView-favicon-margin-start: calc((var(--urlbarView-rich-suggestion-default-icon-size) - var(--urlbarView-favicon-width)) / 2);
    --urlbarView-favicon-margin-end: calc(
      var(--urlbar-icon-padding) + var(--identity-box-margin-inline) +
        ((var(--urlbarView-rich-suggestion-default-icon-size) - var(--urlbarView-favicon-width)) / 2)
    );
  }
}

.urlbarView {
  /* Don't handle window drag events in case we are overlapping a toolbar */
  -moz-window-dragging: no-drag;

  display: block;
  text-shadow: none;
  overflow: clip;
  margin-inline: var(--urlbarView-results-padding);
  width: calc(100% - 2 * var(--urlbarView-results-padding));
}

.urlbarView-body-inner {
  width: calc(100% + 2 * var(--urlbarView-row-gutter));
  margin-inline: calc(-1 * var(--urlbarView-row-gutter));

  #urlbar[open] > .urlbarView > .urlbarView-body-outer > & {
    border-top: 1px solid var(--urlbarView-separator-color);
  }
}

.urlbarView-results {
  padding-block: calc(var(--urlbarView-results-padding) - var(--urlbarView-row-gutter));
  white-space: nowrap;

  /* Vertically center the one-offs when no results are present. */
  .urlbarView[noresults] > .urlbarView-body-outer > .urlbarView-body-inner > & {
    padding-block: 0;
  }
}

.urlbarView-row {
  --urlbarView-second-line-indent: calc(var(--urlbarView-icon-margin-start) + var(--urlbarView-icon-margin-end) + var(--urlbarView-favicon-width));

  /* Align icons that are smaller than the default rich suggestion icon size
    (28px) with default-size rich suggestion icons. */
  /* stylelint-disable-next-line media-query-no-invalid */
  @media -moz-pref("browser.urlbar.richSuggestions.featureGate") {
    &:not([rich-suggestion]),
    &[rich-suggestion][icon-size="16"] {
      --urlbarView-icon-margin-start: var(--urlbarView-favicon-margin-start);
      --urlbarView-icon-margin-end: var(--urlbarView-favicon-margin-end);
    }
    &[rich-suggestion][icon-size="24"] {
      --urlbarView-icon-margin-start: calc((var(--urlbarView-rich-suggestion-default-icon-size) - 24px) / 2);
      --urlbarView-icon-margin-end: calc(
        var(--urlbar-icon-padding) + var(--identity-box-margin-inline) + ((var(--urlbarView-rich-suggestion-default-icon-size) - 24px) / 2)
      );
    }
  }

  display: flex;
  align-items: center;
  fill: currentColor;
  fill-opacity: var(--urlbar-icon-fill-opacity);

  /* Use a transparent border rather than margin such that the view's entire
     hover area is contiguous and a row is always hovered as the user moves the
     mouse across rows, even though each row's highlighted area is smaller. */
  border: var(--urlbarView-row-gutter) solid transparent;
  border-radius: calc(var(--urlbarView-row-gutter) + var(--urlbar-inner-border-radius));
  background-clip: padding-box;

  /* Must hide the overflowing rows while the view is updating */
  &[hidden] {
    display: none !important;
  }

  &[row-selectable]:not([selected]):hover {
    background-color: var(--urlbarView-hover-background);
  }

  &[selected] {
    background-color: var(--urlbarView-highlight-background);
    color: var(--urlbarView-highlight-color);
  }

  &:not([type="tip"], [type="dynamic"]) {
    :root:not([uidensity="compact"]) & {
      min-height: 32px;
    }
    :root[uidensity="touch"] & {
      padding-block: 11px;
    }
  }

  &[rich-suggestion][type="search"] {
    :root:not([uidensity="compact"]) & {
      min-height: 46px;
    }
    :root[uidensity="touch"] & {
      padding-block: 4px;
    }
  }
}

.urlbarView-row-inner,
.urlbarView-no-wrap {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: start;
}

.urlbarView-row-inner {
  flex: 1 1;
  overflow: hidden;
  padding-inline: var(--urlbarView-item-inline-padding);
  padding-block: var(--urlbarView-item-block-padding);

  :root:not([uidensity="compact"]) & {
    min-height: 20px; /* row min-height 32px - (2 * padding-block 6px) */
  }
}

.urlbarView-no-wrap {
  max-width: 100%;
  flex-grow: 0;
  flex-shrink: 0;

  .urlbarView[action-override] .urlbarView-row[has-url] > .urlbarView-row-inner > &,
  .urlbarView-row[has-url]:not([type$="tab"]) > .urlbarView-row-inner > &,
  .urlbarView-row[has-url]:is([type="remotetab"], [sponsored]):is(:hover, [selected]) > .urlbarView-row-inner > & {
    /* We prioritize icons + title + action over the url, so they can grow freely,
       but the url should never disappear when it's visible */
    max-width: calc(70% - 2 * (var(--urlbarView-favicon-width) + (6px + 2px)));
  }
}

/* Wrap the url to a second line when the window is narrow. Do not wrap when the
   window is also short, because fewer results will be shown. */
@media screen and (min-height: 600px) {
  .urlbarView-results[wrap] > .urlbarView-row {
    &:where(:not([rich-suggestion])) > .urlbarView-row-inner {
      flex-wrap: wrap;

      > .urlbarView-no-wrap {
        max-width: 100% !important;
        flex-basis: 100%;
      }
    }

    &[has-url] > .urlbarView-row-inner > .urlbarView-url {
      margin-top: 2px;

      /* urlbarView-url is forced to be LTR for RTL locales, so set the padding based on
         the browser's directionality. */
      &:-moz-locale-dir(ltr) {
        margin-left: var(--urlbarView-second-line-indent);
      }
      &:-moz-locale-dir(rtl) {
        margin-right: var(--urlbarView-second-line-indent);
      }
    }

    /* Note: switchtab entries show the url only in override mode,
       remotetab and sponsored ones only when selected or :hover. */
    .urlbarView[action-override] &[has-url]:not([restyled-search]),
    &[has-url]:not([type$="tab"], [sponsored], [restyled-search]),
    &[has-url]:is([type="remotetab"], [sponsored]):is(:hover, [selected]),
    &[type="tabtosearch"] {
      /* This targets both rich and non-rich results, so not using the child selector here. */
      .urlbarView-title-separator {
        display: none;
      }
    }

    &[type="tabtosearch"] > .urlbarView-row-inner > .urlbarView-no-wrap {
      flex-wrap: wrap;

      > .urlbarView-action {
        flex-basis: 100%;
        margin-inline-start: var(--urlbarView-second-line-indent);
      }
    }

    &[rich-suggestion] > .urlbarView-row-inner > .urlbarView-row-body > .urlbarView-row-body-top {
      flex-wrap: wrap;

      > .urlbarView-row-body-top-no-wrap {
        flex-basis: 100%;
      }

      > .urlbarView-url {
        margin-top: 2px;
      }
    }
  }
}

.urlbarView-overflowable,
.urlbarView-url {
  overflow: hidden;
}

.urlbarView-overflowable[overflow],
.urlbarView-url[overflow] {
  mask-image: linear-gradient(to left, transparent, black 2em);
}

.urlbarView-overflowable[overflow]:not(.urlbarView-title[is-url]):-moz-locale-dir(rtl) {
  mask-image: linear-gradient(to right, transparent, black 2em);
}

.urlbarView-title[is-url]:-moz-locale-dir(rtl),
.urlbarView-url:-moz-locale-dir(rtl) {
  direction: ltr !important;
}

.urlbarView-url:-moz-locale-dir(rtl) {
  /* .urlbarView-url can grow due to `flex-grow: 1`, so without `text-align:
     right`, the URL text would be left-aligned within .urlbarView-url for RTL
     due to the `direction: ltr` rule.  .urlbarView-title does not have this
     problem since it does not have flex. */
  text-align: right;
}

/* Favicon */

.urlbarView-favicon {
  width: var(--urlbarView-favicon-width);
  height: var(--urlbarView-favicon-width);
  align-self: center;
  margin-inline-start: var(--urlbarView-icon-margin-start);
  margin-inline-end: var(--urlbarView-icon-margin-end);
  background-repeat: no-repeat;
  background-size: contain;
  object-fit: contain;
  flex-shrink: 0;
  -moz-context-properties: fill, fill-opacity;

  .urlbarView-row[tail-suggestion] > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    visibility: hidden;
  }

  .urlbarView-row[type="tabtosearch"]:not([selected]) > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    /* We use the URL color for this icon to inherit its accessibility
       properties, like adapting to high contrast modes. We also want to ensure
       contrast from the result highlight. */
    color: var(--link-color);
    -moz-context-properties: fill;
  }
}

/* Type icon */

.urlbarView-type-icon {
  position: absolute;
  width: var(--icon-size-xsmall);
  height: var(--icon-size-xsmall);
  align-self: center;
  margin-top: var(--urlbarView-favicon-width);
  margin-inline-start: calc(var(--urlbarView-icon-margin-start) + var(--urlbarView-favicon-width) - 6px);
  background-repeat: no-repeat;
  background-size: contain;
  -moz-context-properties: fill, stroke;
  stroke: var(--toolbar-field-focus-background-color);

  /* Favicon badges have this priority: pinned > bookmark. */
  .urlbarView-row[type="bookmark"] > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    background-image: url(chrome://browser/skin/bookmark-12.svg);
    fill: var(--toolbarbutton-icon-fill-attention);
  }

  .urlbarView-row[pinned] > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    background-image: url(chrome://browser/skin/pin-12.svg);
    fill: light-dark(rgb(91, 91, 102), rgb(251, 251, 254));
  }

  /* The following badges are used for debugging purposes */
  /* stylelint-disable-next-line media-query-no-invalid */
  @media -moz-pref("browser.urlbar.showDebuggingIcons") {
    .urlbarView-row[type] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before {
      display: flex;
      position: absolute;
      background-color: var(--button-background-color);
      justify-content: center;
      align-items: center;
      border-radius: var(--border-radius-circle);
      width: var(--icon-size-xsmall);
      height: var(--icon-size-xsmall);
      font-size: 10px;
    }

    /* Can't nest due to https://github.com/w3c/csswg-drafts/issues/7433 */
    .urlbarView-row[type="adaptive-history"] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before {
      content: "A";
    }
    .urlbarView-row[type="semantic-history"] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before {
      content: "S";
    }
  }
}

/* Buttons */

.urlbarView-row-buttons {
  display: flex;
  align-items: center;
  justify-content: end;
  flex-wrap: wrap;
}

.urlbarView-button {
  display: inline-block;
  min-width: var(--urlbarView-result-button-size);
  min-height: var(--urlbarView-result-button-size);
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
  margin-inline: 4px;
  -moz-context-properties: fill, fill-opacity;
  border-radius: var(--border-radius-circle);

  &:not(:hover, [selected], [primary], [open]) {
    @media (prefers-contrast) {
      outline: 1px solid currentColor;
      outline-offset: -1px;
    }
  }

  &[selected] {
    outline: var(--focus-outline);
    /* This color assumes that the row is selected and therefore has the usual
       selection background color. */
    outline-color: var(--urlbarView-highlight-color);
    outline-offset: 1px;

    .urlbarView-row:not([selected]) > .urlbarView-row-buttons > & {
      /* If the row is not selected, use the accent color instead. */
      outline-color: var(--border-color-selected);
    }
  }

  .urlbarView-row:is([row-selectable]:hover, [selected]) > &:not(:hover, [open]) {
    color: var(--urlbarView-result-button-selected-color);
    background-color: var(--urlbarView-result-button-selected-background-color);
  }

  &:is(:hover, [open]) {
    color: var(--urlbarView-result-button-hover-color);
    background-color: var(--urlbarView-result-button-hover-background-color);
  }

  & + & {
    margin-inline-start: 0;
  }
}

/* Result menu button */

.urlbarView-button-result-menu {
  background-image: url("chrome://global/skin/icons/more.svg");
  background-color: var(--button-background-color);

  .urlbarView-results:not([disable-resultmenu-autohide])
    > .urlbarView-row:not(:hover, [selected], [descendant-selected])
    > .urlbarView-row-buttons
    > &:not([open]):first-child:empty {
    display: none;

    /* The realtime suggestions' style will be broken if the width will be
       changed by hover. Thus we use the visibility instead of display to keep
       the element size */
    .urlbarView-row[dynamicType^="realtime-"] > .urlbarView-row-buttons > & {
      display: unset;
      visibility: hidden;
    }
  }

  /* Labeled result menu button */

  &:not(:empty) {
    .urlbarView-results:not([wrap]) > .urlbarView-row > .urlbarView-row-buttons > & {
      display: inline-flex;
      align-items: center;
      border-radius: var(--urlbarView-result-button-size);
      padding-inline: 8px 26px;
      background-position-x: right 4px;
      font-size: var(--urlbarView-small-font-size);

      &:-moz-locale-dir(rtl) {
        background-position-x: left 4px;
      }
    }

    .urlbarView-results[wrap] > .urlbarView-row > .urlbarView-row-buttons > & {
      /* Hide the label in narrow windows. */
      font-size: 0;
    }
  }
}

/* Button with label, e.g. tip button */

.urlbarView-button:where(:not(:empty):not(.urlbarView-button-result-menu)),
.urlbarView-splitbutton-dropmarker {
  border-radius: var(--urlbar-inner-border-radius);
  padding: 0.5em 1em;
  font-size: 0.93em;
  font-weight: var(--font-weight-semibold);
  background-clip: padding-box;
  min-height: 16px;
  min-width: 6em;
  text-align: center;
  flex-basis: initial;
  flex-shrink: 0;

  &:not(:hover, [open]) {
    background-color: var(--button-background-color);
  }

  &:is([selected], [primary]) {
    color: var(--button-text-color-primary);
    background-color: var(--color-accent-primary);
    outline-color: var(--border-color-selected);
    outline-offset: var(--focus-outline-offset);

    &:hover {
      background-color: var(--color-accent-primary-hover);
    }

    &:hover:active {
      background-color: var(--color-accent-primary-active);
    }
  }
}

/* Split Button component */
.urlbarView-splitbutton {
  display: flex;
}

.urlbarView-splitbutton-main {
  /* Make the cap to the dropmarker */
  margin-inline-end: 1px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.urlbarView-splitbutton-dropmarker {
  background-image: url("chrome://global/skin/icons/arrow-down-12.svg");
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  padding-inline: 0;
  min-width: 2em;
  border-inline-start: none;
  -moz-context-properties: fill;
  fill: currentColor;
}

/* Row label (a.k.a. group label) */

.urlbarView-row[label] {
  position: relative;
  /* `margin-block-start` controls how far the main part of the row is from the
     main part of the previous row. */
  margin-block-start: var(--urlbarView-labeled-row-margin-top);

  &::before {
    content: attr(label);
    display: block;
    /* Remove the label from the document flow so it doesn't affect the row
       selection and hover states. */
    position: absolute;
    /* `top` controls how far the label is from the main part of the row. */
    top: var(--urlbarView-labeled-row-label-top);
    margin-inline-start: var(--urlbarView-item-inline-padding);
    font-size: 0.8em;
    /* The color and opacity of labels is the same as the "This time, search with"
       text in the search shortcuts. See `.search-panel-header > label` in
       searchbar.css. */
    color: var(--toolbar-field-focus-color);
    opacity: 0.6;
    pointer-events: none;
  }

  /* For tips with row labels, the entire row is moved down by an additional
     var(--urlbarView-labeled-tip-margin-top-extra) so there's more space
     between the tip's top border and the label; see the tip rules. Here we
     compensate so that the label remains the same distance from the previous
     row as it would have had we not moved the tip row down. +1px compensates
     for the tip's top 1px border. */
  &[type="tip"]::before {
    top: calc(var(--urlbarView-labeled-row-label-top) - var(--urlbarView-labeled-tip-margin-top-extra) + 1px);
  }

  :root[lwt-toolbar-field-focus="dark"] &::before {
    /* Same as `.search-panel-header > label` in searchbar.css */
    opacity: 1;
  }
}

/* Feedback acknowledgment */

.urlbarView-row[feedback-acknowledgment] {
  position: relative;
  padding-bottom: 1.94em;

  &::after {
    content: attr(feedback-acknowledgment);
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 0.72em;
    font-size: var(--urlbarView-small-font-size);
    margin-inline-start: calc(var(--urlbarView-item-inline-padding) + var(--urlbarView-favicon-margin-start));
    padding-inline-start: calc(var(--urlbarView-favicon-width) + var(--urlbarView-favicon-margin-end));
    background-image: url("chrome://branding/content/icon32.png");
    background-repeat: no-repeat;
    background-position: 0 center;
    background-size: var(--urlbarView-favicon-width);
    min-height: var(--urlbarView-favicon-width);
  }
}

/* Title */

.urlbarView-title {
  white-space: nowrap;
  /* Explicitly set line-height to avoid excessively tall rows if the title triggers use of
     fallback fonts with extreme metrics. */
  line-height: 1.4;
}

/* user context box */
.urlbarView-userContext {
  border-top: 4px solid var(--identity-tab-color);
}

.urlbarView-userContext-icon {
  height: 14px;
  width: 14px;
  -moz-context-properties: fill;
  vertical-align: top;
}

.urlbarView-userContext-textMode > span {
  font-variant: small-caps;
}

/* Display userContext icon instead of text when window is too narrow. */
.urlbarView-results[wrap] .urlbarView-userContext-textMode,
.urlbarView-results:not([wrap]) .urlbarView-userContext-iconMode {
  display: none;
}

/* Display a shortened version of the tab label when window is too narrow. */
.urlbarView-results[wrap] .urlbarView-tabGroup-fullWidthMode,
.urlbarView-results:not([wrap]) .urlbarView-tabGroup-narrowWidthMode {
  display: none;
}

/* Force the tab group result chiclet to appear at full height, even if it has
 * no text in it. This is the case if the group has no name and the chiclet is
 * in narrow mode. */
.urlbarView-results[wrap] .urlbarView-tabGroup-narrowWidthMode {
  display: inline-block;
}

/* Tail suggestions */

.urlbarView-tail-prefix {
  display: none;
  justify-content: flex-end;
  white-space: pre;

  .urlbarView-row[tail-suggestion] > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    display: inline-flex;
  }

  > .urlbarView-tail-prefix-string {
    visibility: hidden;
  }

  > .urlbarView-tail-prefix-char {
    position: absolute;
  }
}

/* Title separator */

.urlbarView-title-separator {
  &::before {
    content: "\2014";
    margin: 0 0.4em;
    opacity: 0.6;
  }

  .urlbarView-title:empty + .urlbarView-tags:empty + &,
  /* This targets both rich and non-rich results, so not using the child selector here. */
  .urlbarView-row:is([type=search], [restyled-search]):not([selected], [show-action-text], :hover) &,
  .urlbarView-row:not([has-action], [has-url], [restyled-search]) & {
    display: none;
  }

  #searchbar-new & {
    display: none;
  }
}

/* Action labels */

.urlbarView-action {
  white-space: nowrap;

  .urlbarView-title:not(:empty) ~ & {
    font-size: var(--urlbarView-small-font-size);

    /* stylelint-disable-next-line media-query-no-invalid */
    @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
      /* This targets both rich and non-rich results, so not using the child selector here. */
      .urlbarView-row:not(:hover, [selected], [sponsored]) & {
        color: var(--urlbarView-action-color);
      }
    }

    &[slide-in] {
      @media (prefers-reduced-motion: no-preference) {
        animation-name: urlbarView-action-slide-in;
        animation-duration: 350ms;
        animation-timing-function: var(--animation-easing-function);
      }
    }
  }

  .urlbarView-row[sponsored]:not([selected]) > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    opacity: 0.6;
  }

  .urlbarView-row:not([has-action], [has-url], [restyled-search]) > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    display: none;
  }

  /* If action visibility can be toggled the height should always stay the same. */
  .urlbarView-row[has-url]:is([type=remotetab], [sponsored]):is([selected], :hover) > .urlbarView-row-inner > .urlbarView-no-wrap > &,
  /* This targets both rich and non-rich results, so not using the child selector here. */
  .urlbarView-row:is([type=search], [restyled-search]):not([selected], [show-action-text], :hover) &,
  .urlbarView[action-override] .urlbarView-row[type=switchtab] > .urlbarView-row-inner > .urlbarView-no-wrap > & {
    visibility: hidden;
    width: 0;
    margin-inline: 0;
    /* The !important is for the switch-to-tab chiclet when action-override is set.
       Farther down below we add extra padding on .urlbarView-switchToTab to
       account for the tab icon. Without !important here, that padding is
       visible even when the chiclet is hidden due to action-override. */
    padding-inline: 0 !important;
    border-inline: 0;
  }

  #searchbar-new & {
    display: none;
  }
}

/* The slide-in effect is delayed ~100ms to reduce motion during result
   composition. We set opacity: 0 at the 0% keyframe to ensure the text is not
   seen by the user until after the delay. */
@keyframes urlbarView-action-slide-in {
  0%,
  28.6% {
    translate: var(--urlbarView-action-slide-in-distance);
    opacity: 0;
  }
  100% {
    translate: 0;
    opacity: 1;
  }
}

/* Switch-to-tab and Clipboard action text is styled as a chiclet. */
.urlbarView-row[has-action]:is([type="switchtab"], [type="remotetab"], [type="clipboard"]) {
  > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action {
    border-radius: var(--toolbarbutton-border-radius);
    padding: 4px 8px;
    margin-block: -2px;
    margin-inline-start: 8px;

    :root[uidensity="compact"] & {
      padding-block: 3px;

      &.urlbarView-userContext {
        border-block-start-width: 3px;
      }
    }

    &.urlbarView-tabGroup {
      color: light-dark(var(--tab-group-color-pale), var(--tab-group-label-text-dark));
      background-color: light-dark(var(--tab-group-color), var(--tab-group-color-invert));
    }

    /* stylelint-disable-next-line media-query-no-invalid */
    @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
      color: var(--urlbar-box-text-color);
      background-color: var(--urlbar-box-focus-bgcolor);

      &.urlbarView-userContext {
        padding-top: 0;
      }
    }

    /* stylelint-disable-next-line media-query-no-invalid */
    @media -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
      -moz-context-properties: fill, fill-opacity;

      border-inline: 1px solid var(--border-color-deemphasized);
      border-block-end: 1px solid var(--border-color-deemphasized);

      &.urlbarView-switchToTab {
        padding-inline-start: calc(var(--urlbarView-favicon-width) + 8px);
        background-image: url("chrome://browser/content/firefoxview/view-opentabs.svg");
        background-repeat: no-repeat;
        background-position: 4px center;
        background-size: var(--urlbarView-favicon-width);
      }

      &:not(.urlbarView-userContext) {
        border-block-start: 1px solid var(--border-color-deemphasized);
      }

      &:-moz-locale-dir(rtl) {
        background-position-x: right 4px;
      }
    }
  }

  /* stylelint-disable-next-line media-query-no-invalid */
  @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
    &:is([selected], :hover) > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action {
      color: var(--urlbarView-result-button-selected-color);
      background-color: var(--urlbarView-result-button-selected-background-color);
    }
  }
}

.urlbarView:not([action-override]) .urlbarView-row[type="switchtab"],
.urlbarView-row[type="remotetab"]:not([selected], :hover),
.urlbarView-row[type="clipboard"] {
  > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-title-separator::before {
    /* We make the title separator transparent so it stays in the accessibility
       tree. We want screen readers to pause between the result title and the
       switch-to-tab action text. */
    opacity: 0;
    /* -1em for the width of the \2014 character. -.4em to offset the
       margin-inline-start already set on this element. */
    margin-inline-end: -1.4em;
  }
}

/* URLs */

.urlbarView-url {
  flex-grow: 1;
  flex-shrink: 1;
  font-size: var(--urlbarView-small-font-size);
  /* Increase line-height to avoid cutting overhanging glyphs due to masking on
     the element */
  line-height: 1.4;

  /* This targets both rich and non-rich results, so not using the child selector here. */
  .urlbarView-row:not([selected]) & {
    color: var(--link-color);
  }

  .urlbarView-row:is([type="remotetab"], [sponsored]):not([selected], :hover) > .urlbarView-row-inner > &,
  .urlbarView-row:is([show-action-text], [restyled-search]) > .urlbarView-row-inner > &,
  .urlbarView:not([action-override]) .urlbarView-row[type="switchtab"] > .urlbarView-row-inner > & {
    /* Use visibility:collapse instead of display:none since the latter can
       confuse the overflow state of these elements when their content
       changes while they're hidden (bug 1549787). */
    visibility: collapse;
  }
}

/* Tags */

.urlbarView-tags {
  display: flex;
  font-size: var(--urlbarView-small-font-size);
  /* Increase line-height to avoid cutting overhanging glyphs due to masking on
     the element */
  line-height: 1.4;
}

.urlbarView-tag {
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  padding: 0 4px;
  margin-inline-start: 0.4em;
  border-radius: var(--border-radius-small);
}

/* Rich suggestions */

.urlbarView-row[rich-suggestion] > .urlbarView-row-inner {
  align-items: center;
}

.urlbarView-row[rich-suggestion] > .urlbarView-row-inner > .urlbarView-favicon {
  width: var(--urlbarView-rich-suggestion-default-icon-size);
  height: var(--urlbarView-rich-suggestion-default-icon-size);
  flex-basis: var(--urlbarView-rich-suggestion-default-icon-size);
  flex-shrink: 0;
  flex-grow: 0;

  &[icon-size="16"] {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  &[icon-size="24"] {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  &[icon-size="32"] {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  &[icon-size="38"] {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  &[icon-size="52"] {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: var(--border-radius-xsmall);
  }
}

.urlbarView-row[rich-suggestion] > .urlbarView-row-inner > .urlbarView-row-body {
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;

  > .urlbarView-row-body-top {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: baseline;

    > .urlbarView-row-body-top-no-wrap {
      display: flex;
      flex-wrap: nowrap;
      flex-direction: row;
      align-items: baseline;
      flex-shrink: 0;
      min-width: 0;

      .urlbarView-results:not([wrap]) > & {
        /* Limit the title (which is inside .urlbarView-row-body-top-no-wrap) to 70%
           of the width so the URL is never completely hidden. */
        max-width: 70%;
      }
    }
  }

  > .urlbarView-row-body-description {
    max-width: 80ch;
    &:not(:empty) + .urlbarView-row-body-bottom:not(:empty) {
      margin-block-start: 1em;
    }
  }

  > :is(.urlbarView-row-body-description, .urlbarView-row-body-bottom) {
    font-size: var(--urlbarView-small-font-size);
    white-space: normal;
  }
}

/* prettier-ignore */
.urlbarView-row[rich-suggestion]:not([selected]) > .urlbarView-row-inner > .urlbarView-row-body > :is(.urlbarView-row-body-description, .urlbarView-row-body-bottom) {
  color: var(--urlbarView-secondary-text-color);
}

/* Tip rows. Tip result inherits rich suggestion. */

.urlbarView-row[type="tip"] {
  padding-block: 18px;
  border-block: 0;
  border-radius: 0;

  &:not(:last-child) {
    border-bottom: 1px solid var(--urlbarView-separator-color);
    margin-bottom: 4px;
  }

  &:not(:first-child) {
    border-top: 1px solid var(--urlbarView-separator-color);
    margin-top: 4px;
  }

  /* For tips with row labels, move the entire row down by an additional
     var(--urlbarView-labeled-tip-margin-top-extra) so there's more space
     between the tip's top border and the label. They're too close otherwise.
     The row label must also be adjusted; see the row label rules. */
  &[label] {
    margin-top: calc(var(--urlbarView-labeled-row-margin-top) + var(--urlbarView-labeled-tip-margin-top-extra));
  }

  > .urlbarView-row-inner {
    min-height: 32px;
    align-items: center;

    /* Add space between the tip title (and the rest of row-inner) and its
       button. */
    margin-inline-end: 1.8em;

    > .urlbarView-row-body > .urlbarView-row-body-top > .urlbarView-row-body-top-no-wrap {
      flex-shrink: unset;

      > .urlbarView-title {
        white-space: normal;
      }

      > :not(.urlbarView-title) {
        display: none;
      }
    }

    > .urlbarView-row-body > .urlbarView-row-body-top > .urlbarView-url {
      display: none;
    }

    > .urlbarView-row-body > .urlbarView-row-body-description {
      &:not(:empty) {
        /* Keep padding so the entire selected outline for learn more link */
        padding-block: 4px;
      }

      > a {
        white-space: nowrap;
        color: currentColor;
      }

      > a[selected] {
        border-radius: var(--border-radius-small);
        outline: var(--focus-outline);
        outline-offset: var(--link-focus-outline-offset);
      }
    }
  }

  > .urlbarView-row-buttons {
    /* Move the buttons away from the row edge for better visual balance. */
    padding-inline-end: var(--space-large);

    > .urlbarView-button,
    > .urlbarView-splitbutton {
      /* Horizontal space between buttons */
      margin-inline: var(--space-small);
      /* Vertical space between buttons when the row is narrow and the buttons wrap */
      margin-block: var(--space-small);
    }

    > .urlbarView-splitbutton > .urlbarView-splitbutton-dropmarker {
      /* The dropmarker is a `.urlbarView-button` so it gets the usual 4px inline
         margin. Remove it so it doesn't add to the splitbutton margin. */
      margin-inline-end: 0;
    }
  }

  .urlbarView-results[wrap] > & {
    display: block;
    text-align: end;

    > .urlbarView-row-inner {
      display: flex;
      text-align: start;
    }

    &[tip-type="dismissalAcknowledgment"] {
      padding-block: 6px;

      &:last-child {
        padding-block-end: max(0px, 6px - var(--urlbarView-results-padding));
      }
    }
  }
}

/* Sponsored Firefox Suggest rows */

.urlbarView-row[type$="_adm_sponsored"][icon-size="16"] > .urlbarView-row-inner {
  /* Keep the status quo before these rows were rich suggestions, where the row
     height is roughly the same as usual rows. */
  padding-block: 0;
}

/* Other Firefox Suggest rows */

.urlbarView-row[type$="_amo"][icon-size="24"] > .urlbarView-row-inner > .urlbarView-favicon {
  padding: calc((var(--urlbarView-top-pick-large-icon-box-size) - 24px) / 2);
  background-color: var(--urlbar-box-focus-bgcolor);
  border-radius: var(--border-radius-xsmall);
}

.urlbarView-row[type$="_amo"][icon-size="24"]:is([selected], :hover) > .urlbarView-row-inner > .urlbarView-favicon {
  background-color: var(--urlbarView-result-button-selected-background-color);
}

.urlbarView-row[type$="_vpn"][icon-size="32"] > .urlbarView-row-inner > .urlbarView-favicon {
  padding: calc((var(--urlbarView-top-pick-large-icon-box-size) - 32px) / 2);
}

.urlbarView-row[dynamicType="weather"],
.urlbarView-row[type="weather"] {
  /* Use the colors in the icon SVG files except in HCM and when the row is
     selected. Note that the SVG uses light or dark colors as appropriate. */
  &:not([selected]) > .urlbarView-row-inner > .urlbarView-favicon {
    @media not (prefers-contrast) {
      -moz-context-properties: unset;
    }
  }

  /* Map AccuWeather icon IDs to our icons. These IDs come straight from the
     AccuWeather API response via Merino. These rules apply to both the older
     weather UI treatments ("simpler" and "full", which use a dynamic result)
     and the new treatment ("simplest", which is a standard rich suggestion). */
  /* prettier-ignore */
  > .urlbarView-row-inner > .urlbarView-dynamic-weather-currentConditions > .urlbarView-dynamic-weather-currentTemperature > .urlbarView-dynamic-weather-weatherIcon,
  > .urlbarView-row-inner > .urlbarView-favicon {
    /* icon-variation="1" is "Sunny", which we'll use as the default to ensure an
       image is always visible. We don't expect AccuWeather to ever include an
       invalid icon ID, but they may add new ones that aren't recognized by this
       version of Firefox for example. */
    content: url("chrome://browser/skin/weather/sunny.svg");
    &[icon-variation="2"] {
      content: url("chrome://browser/skin/weather/mostly-sunny.svg");
    }
    &:is([icon-variation="3"], [icon-variation="4"], [icon-variation="6"]) {
      content: url("chrome://browser/skin/weather/partly-sunny.svg");
    }
    &[icon-variation="5"] {
      content: url("chrome://browser/skin/weather/hazy-sunshine.svg");
    }
    &:is([icon-variation="7"], [icon-variation="8"]) {
      content: url("chrome://browser/skin/weather/cloudy.svg");
    }
    &[icon-variation="11"] {
      content: url("chrome://browser/skin/weather/fog.svg");
    }
    &[icon-variation="12"] {
      content: url("chrome://browser/skin/weather/showers.svg");
    }
    &:is([icon-variation="13"], [icon-variation="14"]) {
      content: url("chrome://browser/skin/weather/mostly-cloudy-with-showers.svg");
    }
    &[icon-variation="15"] {
      content: url("chrome://browser/skin/weather/thunderstorms.svg");
    }
    &:is([icon-variation="16"], [icon-variation="17"]) {
      content: url("chrome://browser/skin/weather/mostly-cloudy-with-thunderstorms.svg");
    }
    &[icon-variation="18"] {
      content: url("chrome://browser/skin/weather/rain.svg");
    }
    &:is([icon-variation="19"], [icon-variation="20"], [icon-variation="25"]) {
      content: url("chrome://browser/skin/weather/flurries.svg");
    }
    &[icon-variation="21"] {
      content: url("chrome://browser/skin/weather/partly-sunny-with-flurries.svg");
    }
    &:is([icon-variation="22"], [icon-variation="23"]) {
      content: url("chrome://browser/skin/weather/snow.svg");
    }
    &:is([icon-variation="24"], [icon-variation="31"]) {
      content: url("chrome://browser/skin/weather/ice.svg");
    }
    &:is([icon-variation="26"], [icon-variation="29"]) {
      content: url("chrome://browser/skin/weather/freezing-rain.svg");
    }
    &[icon-variation="30"] {
      content: url("chrome://browser/skin/weather/hot.svg");
    }
    &[icon-variation="32"] {
      content: url("chrome://browser/skin/weather/windy.svg");
    }
    &[icon-variation="33"] {
      content: url("chrome://browser/skin/weather/night-clear.svg");
    }
    &:is([icon-variation="34"], [icon-variation="35"], [icon-variation="36"], [icon-variation="38"]) {
      content: url("chrome://browser/skin/weather/night-mostly-clear.svg");
    }
    &[icon-variation="37"] {
      content: url("chrome://browser/skin/weather/night-hazy-moonlight.svg");
    }
    &:is([icon-variation="39"], [icon-variation="40"]) {
      content: url("chrome://browser/skin/weather/night-partly-cloudy-with-showers.svg");
    }
    &:is([icon-variation="41"], [icon-variation="42"]) {
      content: url("chrome://browser/skin/weather/night-partly-cloudy-with-thunderstorms.svg");
    }
    &:is([icon-variation="43"], [icon-variation="44"]) {
      content: url("chrome://browser/skin/weather/night-mostly-cloudy-with-flurries.svg");
    }
  }
}

/* Actions */
.urlbarView-results[actionmode] {
  white-space: wrap;

  > .urlbarView-row {
    display: inline-flex;
  }
}

/* To align the label and action button */
.urlbarView-row[secondary-action] {
  flex-direction: column;
  align-items: flex-start;
}

.urlbarView-actions-container {
  margin-inline-start: calc(
    var(--urlbarView-item-inline-padding) + var(--urlbarView-favicon-margin-start) + var(--urlbarView-favicon-width) + var(--urlbarView-icon-margin-end)
  );
  margin-block-end: var(--urlbarView-item-block-padding);
}

.urlbarView-action-btn {
  font-size: smaller;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--toolbarbutton-border-radius);
  border: 1px solid transparent;
  padding: 0.4em 0.6em;
  display: inline-flex;
  align-items: center;
  background-color: var(--urlbarView-action-button-background-color);
  margin-inline-end: var(--space-large);

  > img {
    width: 16px;
    height: 16px;
    margin-inline-end: 0.4em;
    -moz-context-properties: fill, fill-opacity;
  }

  &:hover {
    background-color: var(--urlbarView-action-button-hover-background-color);
  }

  &[selected],
  &:hover:active {
    outline: var(--focus-outline);
  }

  &.urlbarView-userContext {
    border-top-color: var(--identity-tab-color);
  }

  .urlbarView[action-override] &[data-action="tabswitch"] {
    display: none;
  }

  &[data-action^="tabgroup-"] {
    color: light-dark(var(--tab-group-color-pale), var(--tab-group-label-text-dark));
    background-color: light-dark(var(--tab-group-color), var(--tab-group-color-invert));
    max-width: 30%;

    /* Add offset to the focus / selection indicator as the outline color could
       be close to the group color. */
    outline-offset: 1px;
    margin-inline-start: 1px;

    &:hover {
      opacity: 0.8;
    }

    > .urlbarView-action-btn-label {
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

/* Suggest realtime opt-in */

.urlbarView-row[rich-suggestion][tip-type="realtime_opt_in"] {
  /* `margin-block-end` is large to give enough spacing between the opt-in and the
     row label in the next row. */
  margin-block: var(--urlbarView-item-block-padding) calc(5 * var(--urlbarView-item-block-padding));
  padding-block: 0;
  border-block: none;
  border-radius: var(--border-radius-medium);

  @media not (prefers-contrast) {
    background-color: color-mix(in srgb, var(--button-background-color) 30%, transparent);
  }

  > .urlbarView-row-inner {
    padding: 0;

    > .urlbarView-favicon {
      width: 98px;
      flex-basis: 98px;
      height: auto;
      align-self: stretch;

      margin-inline: 0;
      border-start-start-radius: var(--border-radius-medium);
      border-end-start-radius: var(--border-radius-medium);

      background-color: light-dark(#ddcfff, #4e2e9d);
      fill: none;

      @media (prefers-contrast) {
        background-color: currentColor;
        fill: currentColor;
      }
    }

    > .urlbarView-row-body {
      padding: var(--space-xlarge);

      > .urlbarView-row-body-top > .urlbarView-row-body-top-no-wrap > .urlbarView-title {
        font-weight: var(--heading-font-weight);
      }
    }
  }

  .urlbarView-results[wrap] > & {
    > .urlbarView-row-inner {
      padding: var(--space-large);

      > .urlbarView-favicon {
        border-radius: var(--border-radius-medium);
      }
    }

    > .urlbarView-row-buttons {
      /* Should match `padding-inline-end` of `.urlbarView-row-buttons` in tips. */
      padding-block-end: var(--space-large);
    }
  }
}

/* Basic style for Realtime suggestions */

.urlbarView-realtime-root {
  --green-status-color: light-dark(var(--color-green-60), var(--color-green-20));
  --red-status-color: light-dark(var(--color-red-70), var(--color-red-40));
  --violet-bg-color: light-dark(var(--color-violet-0), var(--color-violet-80));
  --violet-fg-color: light-dark(var(--color-violet-60), var(--color-violet-10));

  @media (prefers-contrast) {
    --violet-bg-color: var(--urlbar-box-focus-bgcolor);
    --violet-fg-color: currentColor;
  }

  align-items: center;

  /* Realtime suggestions can contain many items, which should always wrap. */
  flex-wrap: wrap;

  /* Remove the usual inner padding. Each item in the row will have its own. */
  padding: 0;

  > .urlbarView-realtime-item {
    display: flex;
    align-items: center;

    /* This should match the radius on `.urlbarView-row`. Only visible when there
     are multiple items in a row. */
    border-radius: calc(var(--urlbarView-row-gutter) + var(--toolbarbutton-border-radius));

    /* Inline spacing between multiple items in a row */
    margin-inline-end: var(--space-small);

    /* The block and inline-start padding should match the normal inner inline
     padding we removed above, in order to keep the first item's image aligned
     with the text and images in other rows. */
    padding: var(--urlbarView-item-inline-padding);
    padding-inline-end: var(--space-large);

    .urlbarView-realtime-root:not([selectable]) > &:not([selected]):hover {
      background-color: var(--urlbarView-hover-background);
    }

    &[selected] {
      color: var(--urlbarView-highlight-color);
      background-color: var(--urlbarView-highlight-background);
    }

    > .urlbarView-realtime-image-container {
      display: flex;
      align-items: center;
      justify-content: center;
      width: var(--urlbarView-top-pick-large-icon-box-size);
      height: var(--urlbarView-top-pick-large-icon-box-size);
      margin-inline-end: var(--space-medium);
      border: 1px solid transparent;
      border-radius: var(--border-radius-small);

      fill: currentColor;
      fill-opacity: var(--urlbar-icon-fill-opacity);
      -moz-context-properties: fill, fill-opacity;

      > .urlbarView-realtime-image {
        width: 36px;
        height: auto;
        max-height: 36px;
      }
    }

    > .urlbarView-realtime-description {
      display: flex;
      flex-direction: column;
      text-align: start;
      grid-row-gap: var(--space-xsmall);

      > .urlbarView-realtime-description-bottom {
        display: flex;
        align-items: center;
        font-size: var(--urlbarView-small-font-size);
        color: var(--urlbarView-secondary-text-color);
      }

      > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dot,
      > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dash,
      > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dot,
      > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dash {
        /* stylelint-disable-next-line max-nesting-depth */
        &::before {
          margin-inline: var(--space-xsmall);
          display: inline;
        }

        /* stylelint-disable-next-line max-nesting-depth */
        &:has(+ span:empty) {
          display: none;
        }
      }

      > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dot,
      > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dot {
        /* stylelint-disable-next-line max-nesting-depth */
        &::before {
          content: "·";
        }
      }

      > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dash,
      > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dash {
        /* stylelint-disable-next-line max-nesting-depth */
        &::before {
          content: "–";
        }
      }
    }
  }
}

/* Market suggestions specific */

.urlbarView-row[dynamicType="realtime-market"] > .urlbarView-realtime-root > .urlbarView-realtime-item {
  --market-image-bg-color: var(--urlbar-box-focus-bgcolor);
  --market-image-down-bg-color: light-dark(var(--color-red-0), var(--color-red-90));
  --market-image-up-bg-color: light-dark(var(--color-green-0), var(--color-green-90));

  > .urlbarView-realtime-image-container {
    background-color: var(--market-image-bg-color);

    &[is-arrow] {
      border-color: color-mix(in srgb, currentColor 10%, transparent);

      .urlbarView-realtime-item[change="down"] > & {
        fill: var(--red-status-color);
        border-color: color-mix(in srgb, var(--red-status-color) 10%, transparent);
        background-color: var(--market-image-down-bg-color);
      }
      .urlbarView-realtime-item[change="up"] > & {
        fill: var(--green-status-color);
        border-color: color-mix(in srgb, var(--green-status-color) 10%, transparent);
        background-color: var(--market-image-up-bg-color);
      }

      > .urlbarView-realtime-image {
        width: 20px;
        height: 20px;
      }
    }
  }

  > .urlbarView-realtime-description {
    > .urlbarView-realtime-description-top {
      > .urlbarView-market-name {
        font-weight: var(--font-weight-semibold);
      }
    }

    > .urlbarView-realtime-description-bottom {
      > .urlbarView-market-todays-change-perc {
        font-weight: var(--font-weight-semibold);
      }

      > .urlbarView-market-last-price {
        /* This value is a string like "$123.45 USD". The "USD" part should be small
           caps and the rest should be normal size. */
        text-transform: lowercase;
        font-variant-caps: small-caps;
      }
    }

    .urlbarView-row:not([selected])
      > .urlbarView-realtime-root
      > .urlbarView-realtime-item[change="up"]:not([selected])
      > &
      > .urlbarView-realtime-description-bottom
      > .urlbarView-market-todays-change-perc {
      color: var(--green-status-color);
    }

    .urlbarView-row:not([selected])
      > .urlbarView-realtime-root
      > .urlbarView-realtime-item[change="down"]:not([selected])
      > &
      > .urlbarView-realtime-description-bottom
      > .urlbarView-market-todays-change-perc {
      color: var(--red-status-color);
    }
  }
}

/* Yelp realtime suggestions specific */

.urlbarView-row[dynamicType="realtime-yelpRealtime"] > .urlbarView-realtime-root > .urlbarView-realtime-item {
  --star-size: 12px;

  > .urlbarView-realtime-image-container > .urlbarView-realtime-image {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  > .urlbarView-realtime-description {
    > .urlbarView-realtime-description-top > .urlbarView-yelpRealtime-title {
      font-weight: var(--heading-font-weight);
    }

    > .urlbarView-realtime-description-bottom {
      > .urlbarView-yelpRealtime-description-popularity-star {
        display: inline-block;
        width: var(--star-size);
        height: var(--star-size);
        background-image: url("chrome://global/skin/icons/rating-star.svg");
        background-position: center;
        background-repeat: no-repeat;
        background-size: var(--star-size) var(--star-size);
        margin-inline-end: 0.3ch;

        fill: var(--icon-color);
        -moz-context-properties: fill;
      }

      .urlbarView-row:not([selected])
        > .urlbarView-realtime-root
        > .urlbarView-realtime-item[state="open"]:not([selected])
        > .urlbarView-realtime-description
        > &
        > .urlbarView-yelpRealtime-description-business-hours
        > span {
        color: var(--green-status-color);
      }
      .urlbarView-row:not([selected])
        > .urlbarView-realtime-root
        > .urlbarView-realtime-item[state="closed"]:not([selected])
        > .urlbarView-realtime-description
        > &
        > .urlbarView-yelpRealtime-description-business-hours
        > span {
        color: var(--red-status-color);
      }
    }
  }
}

/* Flight status suggestions specific */

.urlbarView-row[dynamicType="realtime-flightStatus"] > .urlbarView-realtime-root > .urlbarView-realtime-item {
  > .urlbarView-realtime-image-container {
    --airline-fallback-icon-color: #bac2ca;

    border-color: color-mix(in srgb, currentColor 10%, transparent);
    background-color: var(--urlbar-box-focus-bgcolor);

    &[backgroundImageId] {
      background-position: center;
      -moz-context-properties: fill, stroke;
      fill: var(--airline-color, currentColor);
      stroke: var(--airline-color, currentColor);
    }

    &[backgroundImageId="0"] {
      background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-0.svg);
    }

    &[backgroundImageId="1"] {
      background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-1.svg);
    }

    &[backgroundImageId="2"] {
      background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-2.svg);
    }

    &[backgroundImageId="3"] {
      background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-3.svg);
    }

    &[backgroundImageId="4"] {
      background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-4.svg);
    }

    &[hasForegroundImage] {
      /* Move up the progress image if exists */
      background-position-y: bottom 12px;
      /* Move the foreground image to the end corner */
      display: flex;
      justify-content: end;
      align-items: end;
    }

    > .urlbarView-realtime-image[fallback] {
      width: 26px;
      height: 26px;
      flex-basis: 26px;
      fill: var(--airline-fallback-icon-color);
    }
  }

  > .urlbarView-realtime-description {
    > .urlbarView-realtime-description-top > .urlbarView-flightStatus-time {
      font-weight: var(--font-weight-semibold);
      margin-inline-end: var(--space-small);
    }

    > .urlbarView-realtime-description-bottom {
      > .urlbarView-flightStatus-status {
        font-weight: var(--font-weight-semibold);
      }

      .urlbarView-row:not([selected])
        > .urlbarView-realtime-root
        > .urlbarView-realtime-item:is([status="ontime"], [status="inflight"], [status="arrived"]):not([selected])
        > .urlbarView-realtime-description
        > &
        > .urlbarView-flightStatus-status {
        color: var(--green-status-color);
      }

      .urlbarView-row:not([selected])
        > .urlbarView-realtime-root
        > .urlbarView-realtime-item:is([status="cancelled"], [status="delayed"]):not([selected])
        > .urlbarView-realtime-description
        > &
        > .urlbarView-flightStatus-status {
        color: var(--red-status-color);
      }
    }
  }
}

/* Realtime sports suggestions */

.urlbarView-row[dynamicType="realtime-sports"] > .urlbarView-realtime-root > .urlbarView-realtime-item {
  > .urlbarView-realtime-image-container[is-fallback] {
    flex-direction: column;

    background-color: var(--violet-bg-color);
    background-position: center;
    background-repeat: no-repeat;
    border-color: color-mix(in srgb, currentColor 10%, transparent);
    color: var(--violet-fg-color);
    fill: var(--violet-fg-color);
    -moz-context-properties: fill;

    > .urlbarView-sports-scheduled-date-chiclet-day {
      font-size: 1.25em;
    }

    /* Fallback icons per sport but only for games not in the future */
    .urlbarView-realtime-item:not([status="scheduled"]) > & {
      .urlbarView-realtime-item[sport="NBA"] > &,
      .urlbarView-realtime-item[sport="NHL"] > &,
      .urlbarView-realtime-item[sport="NFL"] > & {
        /* stylelint-disable-next-line max-nesting-depth */
        > .urlbarView-sports-scheduled-date-chiclet-day,
        > .urlbarView-sports-scheduled-date-chiclet-month {
          display: none;
        }
      }
      .urlbarView-realtime-item[sport="NBA"] > & {
        background-image: url("chrome://browser/skin/urlbar/sports-basketball.svg");
      }
      .urlbarView-realtime-item[sport="NHL"] > & {
        background-image: url("chrome://browser/skin/urlbar/sports-hockey.svg");
      }
      .urlbarView-realtime-item[sport="NFL"] > & {
        background-image: url("chrome://browser/skin/urlbar/sports-american-football.svg");
      }
    }
  }

  > .urlbarView-realtime-description {
    > .urlbarView-realtime-description-top {
      > .urlbarView-sports-team-names {
        font-weight: var(--font-weight-bold);
      }

      > .urlbarView-sports-score {
        font-weight: var(--font-weight-bold);
        margin-inline-start: var(--space-xsmall);
      }
    }

    > .urlbarView-realtime-description-bottom {
      > .urlbarView-sports-status {
        color: var(--green-status-color);
        font-weight: var(--font-weight-bold);
      }
    }
  }
}

/* Search one-offs */

#urlbar .search-one-offs:not([hidden]) {
  display: flex;
  align-items: start;
  padding-block: 10px;
  flex-wrap: wrap;
}

.urlbarView:not([noresults]) > .search-one-offs:not([hidden]) {
  border-top: 1px solid var(--urlbarView-separator-color);
}

:root[uidensity="touch"] #urlbar .search-one-offs:not([hidden]) {
  padding-block: 15px;
}

#urlbar .search-panel-one-offs-container {
  /* Make sure horizontally we can fit four buttons, empty space, settings. */
  min-width: calc(4 * /* one-off with end margin */ 40px + /* settings with start margin */ 56px);
}

#urlbar .search-panel-header {
  padding: 0;
  min-height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#urlbar .search-panel-one-offs-header-label {
  white-space: nowrap;
  margin: 0;
  padding-inline: var(--urlbarView-item-inline-padding) 18px;
}

#urlbar .searchbar-engine-one-off-item {
  min-width: 28px;
  height: 28px;
  margin-inline: 0 12px;
  border-radius: var(--toolbarbutton-border-radius);
}

#urlbar .searchbar-engine-one-off-item:last-child {
  /* This applies to both the last one-off and the compact settings button */
  margin-inline-end: 0;
}

#urlbar .search-setting-button {
  /* Force empty space before the button */
  margin-inline-start: calc(32px - /* settings start padding */ 8px);
}

.urlbarView-row[source="bookmarks"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-bookmarks {
  list-style-image: url("chrome://browser/skin/bookmark.svg");
  fill: var(--toolbarbutton-icon-fill-attention);
  fill-opacity: 1;
  -moz-context-properties: fill, fill-opacity;
}

.urlbarView-row[source="tabs"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-tabs {
  list-style-image: url("chrome://browser/skin/tab.svg");
  -moz-context-properties: fill, fill-opacity;
  fill: currentColor;
  fill-opacity: var(--urlbar-icon-fill-opacity);
}

.urlbarView-row[source="history"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-history {
  list-style-image: url("chrome://browser/skin/history.svg");
  -moz-context-properties: fill, fill-opacity;
  fill: currentColor;
  fill-opacity: var(--urlbar-icon-fill-opacity);
}

.urlbarView-row[source="actions"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-actions {
  list-style-image: url("chrome://browser/skin/quickactions.svg");
  -moz-context-properties: fill, fill-opacity;
  fill: currentColor;
  fill-opacity: var(--urlbar-icon-fill-opacity);
}

/**
 * We remove the blue fill from the bookmark icon when it is selected. We use
 * a blue color as the selection background-color in some instances (Linux with
 * blue system color; fallback for third-party themes) and we want to ensure
 * contrast.
 */
.urlbarView-row[source="bookmarks"][selected] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-bookmarks[selected] {
  fill: currentColor;
  fill-opacity: var(--urlbar-icon-fill-opacity);
}

/* search bar popup */

#PopupSearchAutoComplete {
  --panel-color: var(--toolbar-field-focus-color);
  --panel-background: var(--toolbar-field-focus-background-color);
  --panel-border-color: var(--arrowpanel-border-color);
}

#PopupSearchAutoComplete::part(content) {
  --panel-padding: var(--panel-subview-body-padding);
  /* NOTE(emilio): Once bug 1551637 is fixed we don't need to use block layout
   * for this (though it doesn't really hurt) */
  display: block;
}

@media not (prefers-contrast) {
  #PopupSearchAutoComplete::part(content) {
    /* Remove the top border since the panel is flush with the input. */
    border-top-width: 0;
  }
}

#PopupSearchAutoComplete .autocomplete-richlistitem[selected] {
  background: var(--urlbarView-highlight-background);
  color: var(--urlbarView-highlight-color);
}