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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* ========================================
   LT Scanner - Section-Specific Styles
   ======================================== */

/*
   NOTE: Many base components defined in common.css:
   - .results-grid (base)
   - .control-panel (override below for scanner)
   - .input-row, .filter-row
   - .empty-state
   - .tf-selector, .tf-btn
   - .view-toggle, .view-btn
*/

/* Results grid - use unified breakpoints from common.css */

/* Base .results-grid defined in common.css */

.results-grid.hidden {
	display: none;
}

/* Preset Modal Styles: .preset-info/.preset-actions live in common.css
   (shared with the backtest alert-config manager). */

.status-inline {
	font-size: var(--font-xs);
	color: var(--text-muted);
	margin-left: var(--space-sm);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 300px;
}

@media (width <= 768px) {
	.status-inline {
		max-width: 120px;
	}
}

/* Run + status side by side above the phone tier. Stacked, the group is
   taller than the filter textarea next to it (58px vs 48px) and sets the
   panel's first-row height for the whole page. The status truncates instead
   of growing, so a long "[1D] Found 300 results (capped)" cannot widen the
   row into a wrap. Left stacked on phones: there the textarea's 150px floor
   plus the help button already exceed the row, so inlining would push the
   group onto a second line and make the panel taller, not shorter.
   Scoped through .control-panel__main so it outranks the .u-stack utility
   the markup carries, instead of depending on stylesheet order. */
@media (width > 768px) {
	.control-panel__main .control-panel__run {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: var(--space-sm);
		min-width: 0;
	}

	.control-panel__main .control-panel__run .status-inline {
		margin-left: 0;
		min-width: 0;
	}
}

/* .empty-state β€” defined in common.css */

/* Filter Controls */

/* Geometry comes from .select-field--sm; only the transparent outline at rest
   is this filter's, so the focus ring does not flash on first click. */
#filter-select {
	outline: var(--radius-sm) solid transparent;
	outline-offset: var(--radius-sm);
}

#filter-select:focus {
	outline: var(--radius-sm) solid var(--accent);
	outline-offset: var(--radius-sm);
	border-color: var(--accent);
}

/* .btn-help-icon β€” promoted to common.css: the reports page carries the same
   "?" next to its filter and does not load this stylesheet, so the button
   rendered unstyled there. The mobile size override is in the shared block. */

/* Date picker */
.date-range-picker {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

.date-picker-input {
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: var(--space-xs) var(--space-sm);
	font-size: var(--font-sm);
	font-family: inherit;
	outline: var(--radius-sm) solid transparent;
	outline-offset: var(--radius-sm);
	width: auto;
	cursor: pointer;
	height: var(--space-xl);
	box-sizing: border-box;
}

.date-picker-input:focus {
	outline: var(--radius-sm) solid var(--accent);
	outline-offset: var(--radius-sm);
	border-color: var(--accent);
}

.date-separator {
	color: var(--text-muted);
	font-size: var(--font-xs);
	user-select: none;
}

/* Active date badge */
.date-badge {
	display: none;
	align-items: center;
	gap: var(--space-xs);
	background: var(--primary);
	color: var(--on-accent);
	padding: var(--space-2xs) var(--space-sm);
	border-radius: var(--radius-md);
	font-size: var(--font-xs);
	font-weight: 600;
	white-space: nowrap;
}

.date-badge.active {
	display: inline-flex;
}

.date-badge .remove-date {
	background: none;
	border: none;
	color: var(--on-accent);
	cursor: pointer;
	font-size: var(--font-lg);
	line-height: 1;
	padding: 0 0 0 var(--space-2xs);
	opacity: 0.7;
}

.date-badge .remove-date:hover {
	opacity: 1;
}

/* The x is a 12px glyph; on a phone its hit area takes the touch floor. */
@media (width <= 480px) {
	.date-badge .remove-date {
		min-width: var(--touch-floor);
		min-height: var(--touch-floor);
	}
}

/* Page header */

/* .page-header β€” defined in common.css */

/* .input-label and .filter-textarea β€” defined in common.css */

/* .tf-selector, .tf-btn β€” defined in common.css */

.view-toggle--main {
	align-self: flex-end;
}

/* Display controls section β€” always visible below primary.
   margin-top is 0 because the border-top is the separator: an extra 8px of
   margin above a 1px rule just pushed the controls away from the row they
   belong to. The panel's own padding (below) absorbs the breathing room. */
.control-panel__display {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
	padding-top: var(--space-xs-plus);
	margin-top: 0;
	border-top: 1px solid var(--border);
}

/* Scans run a 24px-tall timeframe selector, so 8px of panel padding put 33px
   of chrome around 24px of control. Trimmed to 6px: measured +3px of plot on
   every tier, and it applies to the grid and list views too. Qualifier needed
   to outrank .control-panel--compact in common.css, not to win on order. */
.control-panel.control-panel--compact {
	padding-top: var(--space-xs-plus);
	padding-bottom: var(--space-xs-plus);
}

/* Scoped to the scan workspace because .control-panel is shared with every
   other page. Content-sized until a drag gives it a height, after which it
   scrolls instead of pushing the view below it off the screen β€” that scroll
   is what makes shrinking it below its content meaningful rather than a drag
   that appears to do nothing. The help dialog is appended to document.body, so
   nothing in the panel's own overflow can clip it.

   flex-shrink: 0 is what makes that scroll reachable. The panel is the only
   child of the workspace that can absorb a shortfall β€” overflow makes its
   automatic minimum size 0 and nothing sets a flex-shrink β€” so a result set
   taller than the remaining space took the shrink out of the panel itself and
   `overflow: hidden auto` then hid everything past the first row: the Run
   button, the status, the Grid/List/Calendar and Grid/Split toggles, the
   timeframe selector and the More disclosure all became unreachable, in Grid
   view only, at every window width (measured: a 14px panel against 99px of
   content). `.results-grid` cannot shrink below its cards, so with the panel
   out of the negotiation the workspace overflows and the page scrolls, which
   is what Calendar already does via `.calendar-view { flex: 1; min-height: 0 }`.
   `scrollbar-width: thin` is the affordance for the case the floor in
   scan-page.ts cannot cover: content that grows after a drag (opening the More
   disclosure) makes the panel overflow what it was sized to. */
.scan-workspace > .control-panel {
	height: var(--scan-control-height, auto);
	overflow: hidden auto;
	flex-shrink: 0;
	scrollbar-width: thin;
}

@media (width <= 768px) {
	/* Phones: the display row wraps so the disclosure can own a line. It used
	   to, but it now lives at the end of this row, where margin-left:auto
	   pushed it β€” and the date pickers + Copy behind it β€” past the right edge
	   of a strip that has no visible scrollbar, so they were unreachable.
	   The view toggle and the timeframe selector still share the first line
	   (the selector shrinks and scrolls inside itself via the .tf-selector
	   rule in common.css), which costs one line, not three. */
	.control-panel__display {
		flex-wrap: wrap;
		overflow-x: visible;
		scrollbar-width: none;
		padding-bottom: var(--space-xs);
	}

	.control-panel__display::-webkit-scrollbar {
		display: none;
	}

	.control-panel__display > * {
		flex-shrink: 0;
	}

	.control-panel__display .tf-selector {
		flex: 1 1 0;
		min-width: 0;
	}

	.control-panel__display .control-panel__toggle {
		order: 9;
		flex-basis: 100%;
		text-align: center;
	}
}

/* Lightweight separator for display bar */
.nav-sep {
	width: 1px;
	height: var(--icon-size);
	background: var(--border);
	flex-shrink: 0;
}

/* Calendar View Layout
   scan-workspace is the page's own modifier on the shared .page-wrapper: the
   nav is a fixed sidebar, so the wrapper owns the whole viewport height and
   the active view panel claims whatever the control panel leaves over. The
   previous `height: calc(100vh - 220px)` was a hardcoded guess at the chrome
   height, so the calendar either overflowed the fold (taller panel, secondary
   panel open) or left dead space below it (shorter panel).

   A definite `height` (not min-height) is what makes this work: with an
   indefinite height the flex share of the calendar panel is content-sized, so
   the month grid's `1fr` rows resolve to their max-content height and the whole
   page grows past the viewport. The grid view is unaffected β€” its cards cannot
   shrink below min-content, so they overflow the wrapper and scroll the page
   exactly as before. */
.scan-workspace {
	display: flex;
	flex-direction: column;
	height: var(--viewport-h);

	/* The control panel's seam handle is positioned against the workspace,
	   since the panel is its first child and sits at the top: 0. */
	position: relative;
}

.calendar-view {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	animation: fadeIn 0.3s ease-out;
}

.calendar-layout {
	position: relative;
	display: flex;
	gap: var(--space-md);
	flex: 1;
	min-height: 0;

	/* One custom property owns the split: the sidebar's width and the drag
	   handle's position both read it, so a drag can never leave the handle
	   off the seam. The width tiers below override the property, not the
	   panel, which is what lets splitter.ts drop the inline value and hand
	   the width back to the media query when the panels stack. */

	/* 280px sidebar floor: no sidebar token; --split-card-min-mobile has the same value but names a card column. */
	--calendar-sidebar-width: clamp(280px, 38%, 720px);
}

/* The sidebar owns the chart/list seam as well, so both the chart's flex
   basis and its handle's offset read the same property. */
.calendar-sidebar {
	position: relative;
	width: var(--calendar-sidebar-width);
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
	min-height: 0;

	/* The sidebar also owns the chart/list seam, so the chart's flex basis
	   and its handle's offset read this one property. */
	--sidebar-chart-height: 62%;
}

/* Position only: the hit area, the 1px rule, its hover reveal and the focus
   ring are the shared .panel-resize-handle (common.css). The seam rides the
   sidebar's own width, so the handle and the panel read one property. */
.calendar-resize-handle {
	left: var(--calendar-sidebar-width);
}

.sidebar-chart-container {
	/* The chart is the primary read in this panel, so it takes the larger
	   share of the sidebar's height and the day list scrolls in what is left.
	   This share is the multiplier on every pixel reclaimed elsewhere on the
	   page: at 45% a 100px recovery elsewhere reached the plot as 45px.
	   The share is a single token now, so a drag writes one custom property
	   and both this basis and the seam's offset follow it. `min-height: 0` is
	   required, not cosmetic: a flex item's default `min-height: auto` refuses
	   to shrink below its content, which would silently reinstate a floor. */
	flex: 0 0 var(--sidebar-chart-height);
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}


.sidebar-chart-controls {
	display: flex;
	align-items: center;
	gap: var(--space-xs-plus);
	padding-inline: var(--space-sm);
	flex-shrink: 0;
}

/* Stand-in for the symbol the compact card no longer prints in a header of
   its own. Truncates rather than widening the row, so a long ticker cannot
   push Signal/Full off the panel edge. */
.sidebar-chart-symbol {
	font-size: var(--font-sm);
	font-weight: 700;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	margin-right: auto;
}

.sidebar-chart-mode {
	display: flex;
	gap: 1px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.mode-btn {
	background: var(--bg);
	border: none;
	color: var(--text-muted);
	min-height: var(--control-height);
	padding: 0 var(--space-sm);
	font-size: var(--font-xs);
	font-weight: 600;
	cursor: pointer;
	transition:
		background var(--transition-base),
		color var(--transition-base);
}

.mode-btn.active {
	background: var(--accent);
	color: var(--on-accent);
}

.mode-btn:not(.active):hover {
	background: var(--surface-raised);
	color: var(--text);
}

.sidebar-chart {
	flex: 1;
	background: var(--bg);
}

.sidebar-chart-container > .flip-card {
	flex: 1 1 0;
	min-height: 0;
	height: auto;
}

.sidebar-list-container {
	/* Takes whatever the chart does not, and may shrink to nothing: the seam
	   handle is absolutely positioned over the boundary, so a collapsed list
	   is still reachable. `min-height: 0` again for the flex `auto` minimum. */
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: auto hidden;
}

.sidebar-list-header {
	display: flex;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid var(--border);
	font-size: var(--font-xs);
	color: var(--text-muted);
	font-weight: 600;
}

.sidebar-list {
	flex: 1;
	overflow-y: auto;
}

.calendar-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden auto;
}

.calendar-nav-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid var(--border);
}

.calendar-nav-header h2 {
	margin: 0;
	font-size: var(--font-lg);
}

.calendar-nav-controls {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
}

/* The month title and the data-age caption travel together on the left of the
   header, so the header keeps its two groups (title | controls) and the caption
   reads as part of the title rather than as a third column the flex spread
   would have pulled apart. */
.calendar-nav-title {
	display: flex;
	align-items: baseline;
	gap: var(--space-sm);
	min-width: 0;
}

.calendar-nav-title .text-dim {
	font-size: var(--font-xs);
	white-space: nowrap;
}

/* Calendar Grid Implementation
   Only the weekday header row is declared: day cells flow into implicit rows
   via grid-auto-rows, so a month that needs 6 or 7 Mon-Fri rows (any 31-day
   month starting on a Monday) shares the available height instead of
   overflowing into a scrollbar with dead space above it. */
.calendar-grid {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-template-rows: auto;
	grid-auto-rows: minmax(min(64px, 100%), 1fr);
	min-height: 0;
}

.cal-weekday {
	padding: var(--space-xs);
	text-align: center;
	font-size: var(--font-xs);
	font-weight: 700;
	color: var(--text-dim);
	text-transform: uppercase;
	border-bottom: 1px solid var(--border);
}

.cal-day {
	padding: var(--space-xs);
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);

	/* A busy day scrolls inside its own cell instead of silently losing rows. */
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
}

.cal-day:nth-child(7n) {
	border-right: none;
}

/* today/selected styling comes from the shared BEM component in
   common.css (.cal-day--today / .cal-day--selected / .day-num) β€”
   do not re-declare it here. */

/* Scanner-only: number sits above dense stock rows, needs breathing room */
.cal-day .day-num {
	margin-bottom: var(--space-xs);
}

/* Calendar Stock Item */
.cal-stock {
	font-size: var(--font-xs);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	padding: var(--space-2xs) var(--space-xs);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--black) 25%, transparent);
	margin-bottom: 3px;
	gap: var(--space-xs);
	transition: background var(--transition-fast);
}

.cal-stock:hover {
	background: var(--overlay-3);
}

/* A real basis (not 0) so the row can wrap: with `flex: 1` alone the symbol
   shrinks to nothing and the price, change and volume overflow the card at
   tablet width, where their clipped text cannot be reached. */
.cal-stock-symbol {
	font-weight: 700;
	color: var(--accent);
	flex: 1 1 64px;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.cal-stock-symbol:hover {
	text-decoration: underline;
}

.cal-stock-price {
	color: var(--text);
	font-weight: 600;
	min-width: var(--toolbar-height);
	text-align: right;
}

.cal-stock-pct {
	font-weight: 600;
	min-width: var(--toolbar-height);
	text-align: right;
}

.cal-stock-vol {
	color: var(--text-dim);
	min-width: var(--spinner-size);
	text-align: right;
}

.cal-stock-pct.positive {
	color: var(--positive);
}

.cal-stock-pct.negative {
	color: var(--negative);
}

/* News indicator dot for stocks with news */

/* Calendar Day Count Badge */
.cal-day-count {
	position: absolute;
	top: var(--radius-sm);
	right: var(--space-xs);
	background: var(--accent);
	color: var(--on-accent);
	font-size: var(--font-xs);
	font-weight: 700;
	padding: 1px var(--space-xs);
	border-radius: var(--radius-sm);
	min-width: 14px;
	text-align: center;
}

.cal-day-more {
	font-size: var(--font-xs);
	text-align: center;
	color: var(--text-dim);
	padding: var(--space-2xs) 0;
	font-weight: 600;
}

.empty-state-mini {
	padding: var(--space-xl);
	text-align: center;
	color: var(--text-muted);
	font-size: var(--font-sm);
}

/* Sidebar Stock Table */
.sidebar-stock-table {
	width: 100%;
	font-size: var(--font-xs);
}

.sidebar-stock-table thead {
	position: sticky;
	top: 0;
	z-index: var(--z-10);
}

/* Header and cell padding, font and case come from the shared `.data-table`;
   this table keeps only its sticky fill (the page surface), its sort affordance
   and its row rules. */
.sidebar-stock-table th {
	background: var(--bg);
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.sidebar-stock-table th:hover {
	color: var(--text);
}

.sidebar-stock-table td {
	border-bottom: 1px solid var(--border);
	color: var(--text);
	white-space: nowrap;
}

.sidebar-stock-row {
	cursor: pointer;
	transition: background var(--transition-fast);
}

.sidebar-stock-row:hover {
	background: var(--overlay-1);
}

.sidebar-stock-row.active {
	background: var(--overlay-3);
	box-shadow: inset var(--radius-sm) 0 0 var(--accent);
}

.sidebar-stock-row .sidebar-stock-symbol {
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
}

.sidebar-stock-row .sidebar-stock-symbol:hover {
	text-decoration: underline;
}

.sidebar-stock-row td.positive {
	color: var(--positive);
}

.sidebar-stock-row td.negative {
	color: var(--negative);
}

.scan-page .symbol-cell {
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
}

.scan-page .symbol-cell:hover {
	text-decoration: underline;
}

/* ========================================
   Results Table View
   ======================================== */

/* List view claims the same leftover height the calendar does, instead of a
   hardcoded 280px chrome allowance that went wrong whenever the control panel
   grew (secondary panel open, filter textarea resized). */
.results-table-container {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: auto;
	flex: 1;
	min-height: 0;
}

/* Pagination bar under the list view, between the table and the card edge.
   Was a style.cssText assignment in scan-results.ts, with a #222 hairline
   that no palette defines. */
.pagination-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm-plus) var(--space-md);
	margin-top: var(--space-sm);
	border-top: 1px solid var(--border);
}

/* Split Grid Mode */
.split-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(var(--split-card-min), 100%), 1fr));
	gap: var(--space-md);
}

.split-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.split-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid var(--border);
	background: var(--bg);
}

.split-symbol {
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
}

.split-symbol:hover {
	text-decoration: underline;
}

/* ========================================
   Filter Help Dialog
   ======================================== */

/* Width comes from .modal-content--lg. */
.filter-help-content {
	max-width: 95vw;
	max-height: 85vh;
	max-height: 85dvh;
	padding: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--glass-bg);

	/* A 20px blur radius, not a length the token block names: --icon-size shares
	   the value but names a glyph box. */
	backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	box-shadow: 0 var(--space-lg) 60px color-mix(in srgb, var(--black) 60%, transparent);
	animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-help-header {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-md) var(--space-lg);
	border-bottom: 1px solid var(--overlay-2);
	flex-shrink: 0;
}

.filter-help-header h3 {
	margin: 0;
	font-size: var(--font-lg);
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
}

.filter-help-header-hint {
	margin-left: auto;
	display: flex;
	align-items: center;
}

.filter-help-body {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-lg);
	scroll-behavior: smooth;
}

.filter-help-text {
	margin: 0 0 var(--space-sm);
	font-size: var(--font-xs);
	color: var(--text-secondary);
	line-height: 1.6;
}

.filter-help-text code {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	background: color-mix(in srgb, var(--black) 20%, transparent);
	padding: var(--space-2xs) var(--space-xs);
	border-radius: var(--radius-sm);
	color: var(--text);
	border: 1px solid var(--overlay-2);
}

.filter-help-examples {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.filter-help-examples code {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	background: color-mix(in srgb, var(--black) 20%, transparent);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-sm);
	border: 1px solid var(--overlay-2);
	color: var(--positive);
	display: inline-block;
	line-height: 1.5;
	word-break: break-all;
}

.filter-help-label {
	font-size: var(--font-xs);
	color: var(--text-muted);
	margin-bottom: var(--space-xs);
	padding-left: var(--space-sm);
	border-left: var(--radius-sm) solid var(--overlay-3);
}

.filter-help-table {
	width: 100%;
	font-size: var(--font-xs);
	margin-bottom: var(--space-sm);
}

/* The glossary's header and cell padding and font are the shared `.data-table`
   ones; only the row rule and the body colour are this table's own. */
.filter-help-table td {
	border-bottom: 1px solid var(--overlay-2);
	color: var(--text-secondary);
	line-height: 1.6;
	vertical-align: middle;
}

.filter-help-table td:first-child {
	white-space: nowrap;
}

.filter-help-table td code {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	color: var(--accent);
}

.filter-help-table tr:last-child td {
	border-bottom: none;
}

/* ── Custom badges inside table ── */
.fh-badge {
	display: inline-block;
	font-size: var(--font-xs);
	font-weight: 700;
	padding: var(--space-2xs) var(--space-xs-plus);
	border-radius: var(--radius-sm);
	margin-left: var(--space-sm);
	letter-spacing: 0.04em;
	vertical-align: middle;
}

.fh-badge--daily {
	background: var(--neutral-12);
	color: var(--text-secondary);
	border: 1px solid var(--neutral-20);
}

.fh-badge--intraday {
	background: color-mix(in srgb, var(--warning) 10%, transparent);
	color: var(--warning);
	border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent);
}

.fh-badge--metadata {
	background: color-mix(in srgb, var(--info) 10%, transparent);
	color: var(--info);
	border: 1px solid color-mix(in srgb, var(--info) 20%, transparent);
}

.filter-help-table td .fh-col-code {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	color: var(--text);
	background: color-mix(in srgb, var(--black) 20%, transparent);
	padding: var(--space-2xs) var(--space-xs-plus);
	border-radius: var(--radius-sm);
	border: 1px solid var(--overlay-2);
	cursor: pointer;
	transition: all 0.12s ease;
}

.filter-help-table td .fh-col-code:hover {
	color: var(--text-primary);
	background: var(--overlay-3);
	border-color: var(--overlay-4);
}

/* ── Filter Help Dialog β€” Tab-free single-page layout ────── */

.fh-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: color-mix(in srgb, var(--black) 18%, transparent);
	border-bottom: 1px solid var(--overlay-2);
	flex-shrink: 0;
}

.fh-nav-link {
	font-size: var(--font-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	text-decoration: none;
	padding: var(--space-xs) 10px;
	border-radius: var(--radius-round);
	border: 1px solid transparent;
	transition: all var(--transition-base);
	white-space: nowrap;
}

.fh-nav-link:hover {
	color: var(--text-primary);
	background: var(--overlay-3);
	border-color: var(--overlay-4);
}

.fh-block {
	margin-bottom: var(--space-lg);
	padding-bottom: var(--space-md);
	border-bottom: 1px solid var(--overlay-2);
	scroll-margin-top: var(--space-lg);
}

.fh-block:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.fh-h2 {
	margin: 0 0 var(--space-md);
	font-size: var(--font-md);
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.01em;
}

.fh-h3 {
	margin: var(--space-lg) 0 var(--space-sm);
	font-size: var(--font-sm);
	font-weight: 700;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.fh-h4 {
	margin: 0 0 var(--space-sm);
	font-size: var(--font-xs);
	font-weight: 700;
	color: var(--text-primary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.9;
}

.fh-list {
	margin: 0 0 var(--space-sm);
	padding-left: var(--space-lg);
}

.fh-list li {
	font-size: var(--font-xs);
	color: var(--text-secondary);
	line-height: 1.8;
	margin-bottom: var(--space-xs);
}

.fh-k {
	font-weight: 700;
	color: var(--text-primary);
}

.fh-lead {
	color: var(--text-secondary);
}

.fh-muted {
	color: var(--text-muted);
}

.fh-mt-sm {
	margin-top: var(--space-sm);
}

.fh-tier {
	margin: var(--space-lg) 0 var(--space-xs);
	font-size: var(--font-sm);
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: 0.02em;
}

.fh-tier-hint {
	margin: 0 0 var(--space-sm);
}

.fh-kitchen {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	background: color-mix(in srgb, var(--black) 25%, transparent);
	border: 1px solid var(--overlay-2);
	border-radius: var(--radius-md);
	padding: var(--space-md);
	color: var(--accent);
	line-height: 1.7;
	word-break: break-all;
	cursor: pointer;
	transition: all var(--transition-base);
}

.fh-kitchen:hover {
	border-color: var(--overlay-4);
	background: color-mix(in srgb, var(--black) 35%, transparent);
}

.fh-breakdown {
	margin: var(--space-sm) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--space-xs) var(--space-md);
}

.fh-breakdown dt {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	font-weight: 700;
	color: var(--accent);
	white-space: nowrap;
}

.fh-breakdown dd {
	margin: 0;
	font-size: var(--font-xs);
	color: var(--text-secondary);
	line-height: 1.6;
}

.filter-help-table td.fh-success {
	color: var(--success);
	font-weight: 600;
}

.fh-warning {
	color: var(--warning);
}

.filter-help-table td.fh-danger,
.filter-help-text.fh-danger {
	color: var(--danger);
	font-weight: 600;
}

/* ── Premium Search Bar Style ── */
.fh-search-container {
	display: flex;
	align-items: center;
	padding: var(--space-sm) var(--space-lg);
	background: color-mix(in srgb, var(--black) 20%, transparent);
	border-bottom: 1px solid var(--overlay-2);
	position: relative;
	gap: var(--space-sm);
}

.fh-search-icon {
	color: var(--text-muted);
	flex-shrink: 0;
	transition: color var(--transition-base);
}

#fh-search-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: var(--text-primary);
	font-family: inherit;
	font-size: var(--font-sm);
	padding: var(--space-xs) 0;
}

#fh-search-input:focus-visible {
	outline: var(--radius-sm) solid var(--accent);
	outline-offset: var(--radius-sm);
}

#fh-search-input::placeholder {
	color: var(--text-muted);
	opacity: 0.5;
}

#fh-search-input:focus ~ .fh-search-icon {
	color: var(--text-primary);
}

#fh-search-clear {
	background: transparent;
	border: none;
	color: var(--text-muted);
	font-size: var(--font-lg);
	cursor: pointer;
	padding: var(--space-xs);
	line-height: 1;
	border-radius: var(--radius-round);
	transition: all 0.12s ease;
}

#fh-search-clear:hover {
	color: var(--text-primary);
	background: var(--overlay-3);
}

/* ── Collapsible sections ── */

.fh-section {
	border: 1px solid var(--overlay-2);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-sm);
	overflow: hidden;
	background: var(--overlay-1);
	transition: all var(--transition-base);
}

.fh-section:hover {
	border-color: var(--overlay-4);
	background: var(--overlay-2);
}

.fh-section-toggle {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	width: 100%;
	padding: var(--space-sm) var(--space-md);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-primary);
	font-size: var(--font-sm);
	font-weight: 600;
	text-align: left;
	transition: background var(--transition-fast);
}

.fh-section-toggle:hover {
	background: var(--overlay-1);
}

.fh-section-arrow {
	font-size: var(--font-xs);
	color: var(--text-muted);
	width: 14px;
	flex-shrink: 0;
	transition: transform var(--transition-base);
}

.fh-section-title {
	flex: 1;
}

.fh-section-title code {
	background: color-mix(in srgb, var(--black) 20%, transparent);
	padding: var(--space-2xs) var(--space-xs-plus);
	border-radius: var(--radius-sm);
	font-size: var(--font-xs);
	color: var(--text-primary);
}

.fh-section-body {
	padding: var(--space-xs) var(--space-md) var(--space-md);
	border-top: 1px solid var(--overlay-2);
	background: color-mix(in srgb, var(--black) 10%, transparent);
	animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fh-section-body > *:first-child {
	margin-top: var(--space-sm);
}

/* ── Clickable code expressions ── */

code.fh-click {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	background: color-mix(in srgb, var(--black) 20%, transparent);
	padding: var(--space-sm) var(--space-md);
	border-radius: var(--radius-md);
	border: 1px solid var(--overlay-2);
	color: var(--success);
	display: block;
	line-height: 1.5;
	word-break: break-all;
	cursor: pointer;
	position: relative;
	transition: all var(--transition-base);
}

code.fh-click::after {
	content: "πŸ” Load into scanner";
	position: absolute;
	right: var(--space-md);
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--font-sans);
	font-size: var(--font-xs);
	font-weight: 700;
	color: var(--text-muted);
	opacity: 0;
	transition: all var(--transition-base);
}

code.fh-click:hover {
	background: color-mix(in srgb, var(--positive) 8%, transparent);
	color: var(--success-hover);
	border-color: color-mix(in srgb, var(--positive) 30%, transparent);
	padding-right: 140px;
}

code.fh-click:hover::after {
	opacity: 1;
	color: var(--success-hover);
}

code.fh-click:active {
	transform: scale(0.99);
}

/* ── Preset cards ── */

.fh-preset-card {
	padding: var(--space-md);
	border: 1px solid var(--overlay-2);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-sm);
	cursor: pointer;
	background: var(--overlay-1);
	position: relative;
	transition: all var(--transition-base);
}

.fh-preset-card::after {
	content: "πŸ” Load Preset";
	position: absolute;
	right: var(--space-md);
	top: 50%;
	transform: translateY(-50%);
	font-size: var(--font-xs);
	font-weight: 700;
	color: var(--text-muted);
	opacity: 0;
	transition: all var(--transition-base);
}

.fh-preset-card:hover {
	background: var(--overlay-2);
	border-color: var(--overlay-4);
	padding-right: 120px;
}

.fh-preset-card:hover::after {
	opacity: 1;
}

.fh-preset-name {
	font-weight: 600;
	font-size: var(--font-sm);
	color: var(--text-primary);
}

.fh-preset-expr {
	margin-top: var(--space-xs);
}

.fh-preset-expr code {
	font-family: var(--font-mono);
	font-size: var(--font-xs);
	color: var(--text-muted);
	background: none;
	border: none;
	padding: 0;
}

.fh-preset-hint {
	font-size: var(--font-xs);
	color: var(--text-dim);
	margin-top: var(--space-xs);
}

.fh-example-row {
	margin-bottom: var(--space-md);
}

.fh-example-row:last-child {
	margin-bottom: 0;
}

@media (width <= 480px) {
	.filter-help-content {
		width: 100%;
		max-width: 100vw;
		max-height: var(--viewport-h);
		border-radius: var(--radius-none);
		border: none;
	}

	.fh-search-container {
		padding: var(--space-sm);
	}

	.fh-nav {
		padding: var(--space-sm);
	}

	code.fh-click {
		padding: var(--space-sm);
	}

	code.fh-click::after {
		display: none;
	}

	code.fh-click:hover {
		padding-right: var(--space-sm);
	}
}

/* ════════════════════════════════════════════
   Responsive β€” Calendar View y otros layouts
   ════════════════════════════════════════════ */

/* Tablet: narrower sidebar, stackable layout */
@media (width <= 1024px) and (width >= 901px) {
	.calendar-layout {
		--calendar-sidebar-width: var(--aside-width);
	}

	/* Tablet: the chart is the primary read, so give it the larger share of
	   the sidebar's height and let the list scroll in what is left. Same
	   62/38 as the base tier β€” one split to reason about, not three. */
	.sidebar-chart-container {
		flex: 1 1 62%;
		min-height: var(--split-card-min-mobile);
	}

	.sidebar-list-container {
		flex: 1 1 38%;
		min-height: 150px;
	}

	.calendar-nav-header h2 {
		font-size: var(--font-md);
	}

}

/* Tablet chico: sidebar angosta */

/* intentional breakpoint: a width tier, not a column-count change β€” the
   901–1024 tier above keeps the wider sidebar for iPad landscape. */
@media (width <= 900px) and (width >= 769px) {
	.calendar-layout {
		--calendar-sidebar-width: 260px;
	}

	/* Narrow but still side-by-side: keep the roomier of the share and the
	   old 240px floor, expressed as the one token the seam now writes. */
	.calendar-sidebar {
		--sidebar-chart-height: max(62%, 240px);
	}

	.calendar-nav-header h2 {
		font-size: var(--font-sm);
	}

}

/* Mobile: todo apilado vertical */
@media (width <= 768px) {
	/* Stacked natural flow: the desktop workspace reserves a full viewport of
	   height, which a column of sidebar + calendar has no use for on a phone. */
	.scan-workspace {
		display: block;
		height: auto;
	}

	.calendar-view {
		height: auto;
		min-height: auto;
	}

	.calendar-layout {
		flex-direction: column;
		height: auto;

		/* Stacked: the sidebar takes the row's full width and the seam the
		   handle rides on does not exist, so the property is the whole
		   width and the handle is hidden below. */
		--calendar-sidebar-width: 100%;
	}

	.calendar-sidebar {
		height: auto;

		/* Stacked, the sidebar's height is content-driven, so a percentage
		   basis would resolve to `auto` and hand the chart back to its
		   content. An explicit token keeps the two 320px panels and leaves the
		   seam between them draggable. */
		--sidebar-chart-height: 320px;
	}

	/* Stacked: there is no width seam to drag. splitter.ts also stops applying
	   a stored width here, so the rule above is the one that wins. The row seam
	   stays: the sidebar is still two panels stacked, and a touch drag on it
	   works. */
	.calendar-resize-handle {
		display: none;
	}


	.sidebar-chart-container {
		flex: 0 0 var(--sidebar-chart-height);
	}

	.sidebar-list-container {
		flex: none;
		height: 320px;
	}

	/* Stacked, the workspace's height is content-driven too, so the control
	   panel's seam would chase its own ceiling. */
	#scan-control-resize {
		display: none;
	}

	.calendar-main {
		min-height: var(--split-card-min);
	}

	.calendar-grid {
		grid-template-columns: repeat(5, 1fr);
		grid-template-rows: auto;
		grid-auto-rows: minmax(min(60px, 100%), 1fr);
		min-height: 300px;
	}

	.cal-day {
		padding: var(--space-2xs);
	}

	/* The day number is the shared .day-num (common.css), not a .cal-day-num
	   that no markup ever renders. */
	.cal-day .day-num {
		font-size: var(--font-xs);
	}

	.cal-stock {
		font-size: var(--font-xs);
		padding: 1px var(--space-2xs);
	}

	.cal-stock-symbol {
		font-size: var(--font-xs);
	}

	.cal-stock-price,
	.cal-stock-pct {
		min-width: var(--spinner-size);
		font-size: var(--font-xs);
	}

	.cal-day-count {
		font-size: var(--font-xs);
		padding: 1px 3px;
		min-width: var(--space-sm-plus);
		top: 1px;
		right: var(--radius-sm);
	}

	.calendar-nav-header {
		padding: var(--space-sm);
	}

	.calendar-nav-header h2 {
		font-size: var(--font-sm);
	}

	.sidebar-chart-controls {
		flex-wrap: wrap;
	}


	.split-grid {
		grid-template-columns: repeat(auto-fill, minmax(min(var(--split-card-min-mobile), 100%), 1fr));
	}
}

/* Muy chico: calendar header controls compactos */
@media (width <= 480px) {
	.calendar-grid {
		grid-template-columns: repeat(5, 1fr);
		grid-auto-rows: minmax(min(var(--touch-min), 100%), 1fr);
	}

	.cal-day {
		padding: 1px;
		min-height: 56px;
	}

	/* Touch targets: bump sub-44px controls on phones. `.cal-nav-btn` is
	   shared with the trades calendar and so is sized by the one rule in
	   common.css, which this page's duplicate used to contradict at 40px --
	   below the app's own --touch-min. */
	.date-picker-input {
		height: var(--trades-layout-offset);
	}

	/* Hiding the whole row left the calendar counting tickers without
	   saying which ones β€” the main information of the view. Keep the
	   symbol and drop the numbers that cannot fit a 62px cell. */
	.cal-stock-price,
	.cal-stock-pct,
	.cal-stock-vol {
		display: none;
	}

	.cal-day-count {
		display: flex;
	}

	.split-grid {
		grid-template-columns: 1fr;
	}

	.presets-panel {
		grid-template-columns: 1fr;
	}

	.filter-help-content {
		max-width: 100vw;
		max-height: var(--viewport-h);
		border-radius: var(--radius-none);
	}

	.filter-help-header {
		padding: var(--space-sm);
	}

	.filter-help-body {
		padding: var(--space-sm);
	}
}

/* ── Scan toolbar: one calm row ──
   Filter, help, Run and status, the view switch, then Advanced at the right
   end. The row wraps on narrow widths instead of scrolling sideways. */
.scan-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
}

.scan-toolbar__filter {
	flex: 1 1 24rem;
	min-width: 12rem;
	min-height: 2.25rem;
	height: 2.25rem;
	resize: none;
	overflow: hidden;
	white-space: nowrap;
	font-family: var(--font-mono);
	transition: height var(--transition-fast);
}

.scan-toolbar__filter:focus {
	height: 6rem;
	white-space: pre-wrap;
	overflow: auto;
}

.scan-toolbar__status {
	white-space: nowrap;
}

.scan-toolbar__advanced {
	margin-left: auto;
	flex-shrink: 0;
}

/* The Advanced popover hangs below the toolbar; the toolbar must not clip it. */
.scan-workspace > .scan-toolbar {
	overflow: visible;
}

/* Touch screens: the sidebar mode buttons are at least 36px tall. */
@media (pointer: coarse) {
	.scan-workspace [id^="sidebar-mode-"],
	.scan-workspace [id^="sidebar-watchlist-btn"] {
		min-height: var(--touch-target-size);
		min-width: var(--touch-target-size);
	}
}

@media (width <= 600px) {
	.scan-workspace [id^="sidebar-mode-"] {
		min-height: var(--touch-target-size);
	}
}

/* ── Phone: chart first, then the day's stocks in a scrolling table ──
   The day chart is a fixed 36% of the viewport (--scan-chart-phone-height), so the day list starts above
   the fold instead of under a full-height chart. The table scrolls inside its
   own box (#sidebar-list), keeps its columns at their natural width instead of
   squeezing them, and pins the symbol column so the rest can scroll under it
   without losing the row's name. */
@media (width <= 480px) {
	.sidebar-chart-container {
		flex: 0 0 var(--scan-chart-phone-height);
	}

	#sidebar-list {
		overflow: auto;
		overscroll-behavior: contain;
	}

	.sidebar-stock-table {
		width: max-content;
		min-width: 100%;
	}

	.sidebar-stock-table th:first-child,
	.sidebar-stock-table td:first-child {
		position: sticky;
		left: 0;
		z-index: var(--z-10);
		background: var(--surface-1);
	}
}