Skip to main content

euv_ui/style/class/page/
fn.rs

1use super::*;
2
3class! {
4    // ═══════════════════════════════════════════════════════════════════════════
5    // Camera Page
6    // ═══════════════════════════════════════════════════════════════════════════
7
8    pub c_camera_video_container {
9        margin: format!("{} 0", var!(space-lg));
10    }
11
12    pub c_camera_video_active {
13        width: "100%";
14        background: var!(surface-media);
15        aspect-ratio: "16 / 9";
16        object-fit: "cover";
17        border: format!("2px solid {}", var!(primary));
18        box-sizing: "border-box";
19    }
20
21    pub c_camera_video_hidden {
22        width: "100%";
23        aspect-ratio: "16 / 9";
24        display: "none";
25    }
26
27    pub c_camera_video_placeholder {
28        width: "100%";
29        aspect-ratio: "16 / 9";
30        border: format!("2px dashed {}", var!(border));
31        display: "flex";
32        align-items: "center";
33        justify-content: "center";
34        box-sizing: "border-box";
35    }
36
37    pub c_camera_placeholder_content {
38        display: "flex";
39        flex-direction: "column";
40        align-items: "center";
41        gap: var!(space-md);
42    }
43
44    pub c_camera_placeholder_icon {
45        font-size: var!(font-4xl);
46        opacity: "1";
47    }
48
49    pub c_camera_placeholder_text {
50        font-size: var!(font-base);
51        color: "inherit";
52        opacity: "1";
53    }
54
55    pub c_camera_error_box {
56        margin: format!("{} 0px", var!(gap-component));
57        color: var!(destructive);
58        font-size: var!(font-base);
59        word-break: "break-all";
60        overflow-wrap: "break-word";
61        box-sizing: "border-box";
62    }
63
64    pub c_camera_scan_result_box {
65        margin-top: var!(gap-component);
66        box-sizing: "border-box";
67    }
68
69    pub c_camera_scan_result_label {
70        font-size: var!(font-sm);
71        font-weight: var!(font-weight-semibold);
72        color: var!(foreground);
73        margin-bottom: var!(space-xs);
74    }
75
76    pub c_camera_scan_result_value {
77        font-size: var!(font-base);
78        color: "inherit";
79        word-break: "break-all";
80        overflow-wrap: "break-word";
81    }
82
83    // ═══════════════════════════════════════════════════════════════════════════
84    // Canvas Drawing Board
85    // ═══════════════════════════════════════════════════════════════════════════
86
87    pub c_canvas_preview_container {
88        margin: format!("{} 0", var!(space-lg));
89        overflow: "hidden";
90        border: format!("2px solid {}", var!(border));
91        background: var!(surface-drawing);
92        aspect-ratio: "9 / 16";
93        display: "flex";
94        align-items: "center";
95        justify-content: "center";
96        box-sizing: "border-box";
97    }
98
99    pub c_canvas_placeholder {
100        color: var!(muted-foreground);
101        font-size: var!(font-sm);
102        text-align: "center";
103        padding: var!(space-lg);
104    }
105
106    pub c_canvas_preview_image {
107        width: "100%";
108        height: "100%";
109        object-fit: "cover";
110        display: "block";
111    }
112
113    pub c_canvas_container_fullscreen {
114        width: "100%";
115        height: "100%";
116        background: var!(background);
117        display: "flex";
118        flex-direction: "column";
119        position: "fixed";
120        top: "0";
121        left: "0";
122        z-index: "10002";
123        padding: format!("{} {} {} {}", var!(padding-shell-top), var!(space-lg), var!(padding-shell-bottom), var!(space-lg));
124        box-sizing: "border-box";
125    }
126
127    pub c_canvas_drawing_fullscreen_wrapper {
128        flex: "1";
129        display: "flex";
130        align-items: "center";
131        justify-content: "center";
132        overflow: "hidden";
133        padding: var!(space-xs);
134    }
135
136    pub c_canvas_drawing_fullscreen {
137        border: format!("2px solid {}", var!(border));
138        display: "block";
139        cursor: "crosshair";
140        touch-action: "none";
141    }
142
143    pub c_canvas_fullscreen_toolbar {
144        display: "flex";
145        flex-direction: "column";
146        align-items: "stretch";
147        width: "100%";
148        padding: format!("{} {}", var!(space-xs), "0px");
149        flex-shrink: "0";
150        gap: var!(space-xs);
151    }
152
153    pub c_canvas_fullscreen_toolbar_row_top {
154        display: "flex";
155        align-items: "center";
156        height: var!(mobile-header-height);
157        width: "100%";
158        gap: var!(space-sm);
159    }
160
161    pub c_canvas_fullscreen_toolbar_color_wrapper {
162        display: "flex";
163        align-items: "center";
164        justify-content: "center";
165        flex: "1";
166        min-width: "0";
167    }
168
169    pub c_canvas_color_input_fullscreen {
170        width: "100%";
171        height: "42px";
172        border: format!("{} solid {}", var!(border-width), var!(border));
173        cursor: "pointer";
174        padding: format!("{}", var!(space-xs));
175    }
176
177    pub c_canvas_fullscreen_toolbar_row_bottom {
178        display: "flex";
179        align-items: "center";
180        width: "100%";
181    }
182
183    pub c_canvas_fullscreen_range_input {
184        flex: "1 1 0%";
185        min-width: "120px";
186        cursor: "pointer";
187        -webkit-appearance: "none";
188        appearance: "none";
189        border: "none";
190        outline: "none";
191        height: "24px";
192        ::-webkit-slider-runnable-track {
193            height: "6px";
194            background: format!("linear-gradient(to right, {} 0%, {} var(--value,50%), {} var(--value,50%), {} 100%)", var!(foreground), var!(foreground), var!(border), var!(border));
195            border-radius: var!(radius-xs);
196            border: "none";
197        }
198        ::-webkit-slider-thumb {
199            width: "20px";
200            height: "20px";
201            background: var!(background);
202            border: format!("2px solid {}", var!(primary));
203            border-radius: var!(radius-full);
204            cursor: "pointer";
205            -webkit-appearance: "none";
206            // The thumb is taller than the track it rides on, so the margin
207            // pulls it up until it sits centred on the track.
208            margin-top: format!("calc(({} - {}) / 2)", var!(space-xs-sm), var!(space-xl));
209        }
210        ::-moz-range-track {
211            height: "6px";
212            background: format!("linear-gradient(to right, {} 0%, {} var(--value,50%), {} var(--value,50%), {} 100%)", var!(foreground), var!(foreground), var!(border), var!(border));
213            border-radius: var!(radius-xs);
214            border: "none";
215        }
216        ::-moz-range-thumb {
217            width: "20px";
218            height: "20px";
219            background: var!(background);
220            border: format!("2px solid {}", var!(primary));
221            border-radius: var!(radius-full);
222            cursor: "pointer";
223        }
224    }
225
226    pub c_canvas_fullscreen_toolbar_button {
227        flex: "0 0 auto";
228        overflow: "hidden";
229    }
230
231    // ═══════════════════════════════════════════════════════════════════════════
232    // Game Fullscreen (2D / 3D)
233    // ═══════════════════════════════════════════════════════════════════════════
234
235    // Fullscreen overlay container for the 2D and 3D game pages.
236    //
237    // Mirrors `c_canvas_container_fullscreen` so the safe-area caching
238    // pass in `UseEuvLayout::apply_cached_insets` can pick this selector
239    // up alongside the canvas one. Differs in that the game overlay holds
240    // the *same* `<canvas>` element that the inline page mounts (no
241    // canvas re-creation), so the running game loop, balls, cubes, FPS
242    // counter and other reactive state survive the fullscreen toggle
243    // without reset.
244    pub c_game_container_fullscreen {
245        width: "100%";
246        height: "100%";
247        background: var!(background);
248        display: "flex";
249        flex-direction: "column";
250        position: "fixed";
251        top: "0";
252        left: "0";
253        z-index: "10002";
254        padding: format!(
255        "{} {} {} {}",
256        var!(padding-shell-top),
257        var!(space-lg),
258        var!(padding-shell-bottom),
259        var!(space-lg)
260        );
261        box-sizing: "border-box";
262    }
263
264    // Toolbar wrapping the fullscreen exit button on game pages.
265    //
266    // Game pages only need an `Exit` button here (no color picker / line
267    // width control like the canvas drawing board), so the layout is a
268    // single horizontal row at the bottom of the overlay.
269    pub c_game_fullscreen_toolbar {
270        display: "flex";
271        align-items: "center";
272        justify-content: "flex-end";
273        width: "100%";
274        padding: format!("{} {} {} {}", var!(space-xs), var!(space-lg), var!(space-xs), var!(space-lg));
275        flex-shrink: "0";
276        gap: var!(space-sm);
277        box-sizing: "border-box";
278    }
279
280    // Wrapper that fills the fullscreen game container with the canvas.
281    //
282    // The game's `<canvas>` backing buffer is 600x400 (3:2). The canvas
283    // itself has `width: 100%; height: 100%` so it fills this wrapper
284    // exactly, and `object-fit: contain` on the canvas class makes the
285    // browser uniformly scale the backing buffer to fit while preserving
286    // its 3:2 aspect ratio. Without `object-fit: contain`, the canvas
287    // would be stretched to whatever shape the wrapper has, making balls
288    // render as horizontally-ovoid ellipses (e.g. on 1280x800 viewports
289    // → 1.6:1, slightly squashed vertically). The letterbox bars appear
290    // inside the canvas element rather than around an outer wrapper, so
291    // the canvas always fills the fullscreen container with the backing
292    // buffer uniformly scaled to its native aspect ratio.
293    pub c_game_fullscreen_canvas_letterbox {
294        position: "relative";
295        width: "100%";
296        max-width: "100%";
297        max-height: "100%";
298        height: "100%";
299        display: "flex";
300        align-items: "center";
301        justify-content: "center";
302    }
303
304    // ═══════════════════════════════════════════════════════════════════════════
305    // Custom Attrs Demo
306    // ═══════════════════════════════════════════════════════════════════════════
307
308    pub c_custom_attrs_demo {
309        // Use the theme foreground token (not `inherit`) so the text inside
310        // the dynamic demo block stays readable when the block itself
311        // applies a user-supplied background (e.g. `background-color: #000000`)
312        // that otherwise paints the inherited text the same colour.
313        color: var!(foreground);
314        box-sizing: "border-box";
315    }
316
317    pub c_demo_text {
318        color: var!(foreground);
319        margin-bottom: var!(gap-component);
320    }
321
322    pub c_demo_text_muted {
323        color: var!(foreground);
324        opacity: "1";
325        font-size: var!(font-base);
326        margin-bottom: "0px";
327    }
328
329    // ═══════════════════════════════════════════════════════════════════════════
330    // Conditional Rendering Demo
331    // ═══════════════════════════════════════════════════════════════════════════
332
333    pub c_toggle_content {
334        margin-top: var!(gap-component);
335        color: "inherit";
336    }
337
338    pub c_toggle_title {
339        margin-top: "0px";
340        color: var!(primary);
341        font-size: var!(font-md);
342    }
343
344    pub c_role_button_row {
345        display: "flex";
346        flex-wrap: "nowrap";
347        gap: var!(gap-element);
348        margin-bottom: var!(gap-component);
349    }
350
351    pub c_role_guest_text {
352        color: var!(foreground);
353        font-size: var!(font-base);
354    }
355
356    pub c_role_user_text {
357        color: var!(foreground);
358        font-size: var!(font-base);
359    }
360
361    pub c_role_admin_text {
362        color: var!(foreground);
363        font-size: var!(font-base);
364    }
365
366    // ═══════════════════════════════════════════════════════════════════════════
367    // 404 Not Found
368    // ═══════════════════════════════════════════════════════════════════════════
369
370    pub c_render_count_text {
371        font-size: var!(font-base);
372        color: "inherit";
373        margin-bottom: var!(gap-component);
374    }
375
376    // ═══════════════════════════════════════════════════════════════════════════
377    // Event Demo
378    // ═══════════════════════════════════════════════════════════════════════════
379
380    pub c_event_result {
381        font-size: var!(font-base);
382        color: "inherit";
383        margin-top: var!(gap-element);
384    }
385
386    pub c_event_highlight {
387        font-weight: var!(font-weight-semibold);
388        color: var!(primary);
389    }
390
391    pub c_event_info_grid {
392        display: "grid";
393        grid-template-columns: "minmax(0px, 1fr) minmax(0px, 1fr)";
394        gap: var!(gap-element);
395        margin-top: var!(gap-component);
396        @media ((max-width: 767px)) {
397            grid-template-columns: "1fr";
398            gap: var!(gap-element);
399        }
400    }
401
402    pub c_event_info_row {
403        display: "flex";
404        align-items: "center";
405        gap: var!(space-sm);
406        overflow: "hidden";
407    }
408
409    pub c_event_info_label {
410        font-size: var!(font-base);
411        font-weight: var!(font-weight-semibold);
412        color: var!(foreground);
413        flex-shrink: "0";
414    }
415
416    pub c_event_info_value {
417        c_text_ellipsis();
418        font-size: var!(font-base);
419        font-weight: var!(font-weight-semibold);
420        color: var!(primary);
421        font-family: var!(font-family-mono);
422        flex: "1";
423    }
424
425    pub c_event_mouse_area {
426        min-height: "120px";
427        padding: format!("{} 0px", var!(space-xl));
428        border: format!("2px dashed {}", var!(border));
429        cursor: "crosshair";
430        text-align: "center";
431        user-select: "none";
432        color: "inherit";
433    }
434
435    pub c_event_drag_zone {
436        min-height: "100px";
437        padding: format!("{} 0px", var!(space-xl));
438        border: format!("2px dashed {}", var!(border));
439        text-align: "center";
440        user-select: "none";
441        color: var!(foreground);
442    }
443
444    pub c_event_drag_zone_active {
445        min-height: "100px";
446        padding: format!("{} 0px", var!(space-xl));
447        border: format!("2px dashed {}", var!(border));
448        text-align: "center";
449        user-select: "none";
450        color: var!(foreground);
451    }
452
453    pub c_event_drag_item {
454        display: "inline-block";
455        padding: format!("{} {}", var!(space-sm), var!(space-xl));
456        background: var!(primary);
457        color: var!(primary-foreground);
458        font-size: var!(font-base);
459        font-weight: var!(font-weight-medium);
460        cursor: "grab";
461        margin: var!(space-sm);
462    }
463
464    pub c_event_drop_zone {
465        border: format!("2px dashed {}", var!(border));
466        padding: format!("{} {}", var!(space-4xl), var!(space-xl));
467        text-align: "center";
468        cursor: "pointer";
469    }
470
471    pub c_event_drop_zone_active {
472        border: format!("2px dashed {}", var!(primary));
473        padding: format!("{} {}", var!(space-4xl), var!(space-xl));
474        text-align: "center";
475        cursor: "pointer";
476        background: var!(muted);
477    }
478
479    pub c_event_drop_icon {
480        font-size: var!(font-5xl);
481        display: "block";
482        padding-bottom: var!(space-md);
483    }
484
485    pub c_event_drop_text {
486        font-size: var!(font-lg);
487        font-weight: var!(font-weight-medium);
488        color: "inherit";
489        padding-bottom: var!(space-md);
490    }
491
492    pub c_event_drop_hint {
493        font-size: var!(font-base);
494        color: "inherit";
495        opacity: "1";
496        margin: "0px";
497    }
498
499    pub c_event_wheel_zone {
500        min-height: "120px";
501        padding: format!("{} 0px", var!(space-xl));
502        border: format!("2px dashed {}", var!(border));
503        text-align: "center";
504        overflow: "auto";
505        color: var!(foreground);
506    }
507
508    pub c_event_clipboard_area {
509        color: var!(foreground);
510    }
511
512    pub c_event_touch_zone {
513        min-height: "120px";
514        padding: format!("{} 0px", var!(space-xl));
515        border: format!("2px dashed {}", var!(primary));
516        text-align: "center";
517        touch-action: "none";
518        user-select: "none";
519        color: var!(primary);
520    }
521
522    pub c_event_form_area {
523        padding: format!("{} 0px", var!(space-lg));
524        color: var!(foreground);
525    }
526
527    pub c_event_media_area {
528        padding: format!("{} 0px", var!(space-lg));
529        color: var!(foreground);
530        max-width: "100%";
531        overflow: "hidden";
532    }
533
534    pub c_event_audio {
535        width: "100%";
536        max-width: "100%";
537    }
538
539    pub c_event_video_area {
540        color: var!(foreground);
541        width: "100%";
542        overflow: "hidden";
543    }
544
545    pub c_event_video {
546        width: "100%";
547        max-width: "100%";
548    }
549
550    pub c_event_image_area {
551        padding: format!("{} 0px", var!(space-lg));
552        color: "inherit";
553        width: "100%";
554        overflow: "hidden";
555        display: "flex";
556        flex-direction: "column";
557        align-items: "center";
558        gap: var!(space-md);
559    }
560
561    pub c_event_image {
562        width: "200px";
563        max-width: "100%";
564        object-fit: "contain";
565        display: "block";
566    }
567
568    pub c_event_url_text {
569        text-align: "center";
570        font-size: var!(font-sm);
571        color: "inherit";
572        opacity: "1";
573        font-family: var!(font-family-mono);
574        word-break: "break-all";
575        width: "100%";
576    }
577
578    // ═══════════════════════════════════════════════════════════════════════════
579    // Timer Demo
580    // ═══════════════════════════════════════════════════════════════════════════
581
582    pub c_timer_display {
583        text-align: "center";
584        padding: var!(space-xl);
585        margin: format!("{} 0px", var!(gap-component));
586        color: "inherit";
587    }
588
589    pub c_timer_value {
590        font-size: var!(font-base);
591        font-weight: var!(font-weight-bold);
592        color: var!(primary);
593        letter-spacing: var!(letter-spacing-wide);
594        font-family: var!(font-family-mono);
595    }
596
597    pub c_timer_controls {
598        display: "flex";
599        flex-wrap: "wrap";
600        gap: var!(gap-element);
601    }
602
603    pub c_timer_done {
604        text-align: "center";
605        margin-top: var!(gap-component);
606        font-size: var!(font-lg);
607        font-weight: var!(font-weight-semibold);
608        color: var!(foreground);
609    }
610
611    // ═══════════════════════════════════════════════════════════════════════════
612    // Browser API Demo
613    // ═══════════════════════════════════════════════════════════════════════════
614
615    pub c_browser_api_row {
616        display: "grid";
617        grid-template-columns: "minmax(0px, 1fr) minmax(0px, 1fr)";
618        gap: var!(gap-component);
619        margin-bottom: var!(gap-component);
620        @media ((max-width: 767px)) {
621            grid-template-columns: "1fr";
622        }
623    }
624
625    pub c_browser_api_actions {
626        display: "flex";
627        flex-wrap: "wrap";
628        gap: var!(gap-element);
629        margin: format!("{} 0px", var!(gap-component));
630    }
631
632    pub c_browser_result_box {
633        margin-top: var!(gap-component);
634        font-size: var!(font-base);
635        word-break: "break-all";
636        color: "inherit";
637    }
638
639    pub c_browser_result_label {
640        font-weight: var!(font-weight-semibold);
641        color: var!(primary);
642    }
643
644    pub c_browser_result_value {
645        color: "inherit";
646    }
647
648    pub c_browser_info_grid {
649        display: "grid";
650        gap: var!(gap-component);
651        margin-top: var!(gap-component);
652        @media ((max-width: 767px)) {
653            grid-template-columns: "1fr";
654        }
655    }
656
657    pub c_browser_info_item {
658        display: "flex";
659        flex-direction: "column";
660        gap: var!(space-xs);
661        color: "inherit";
662    }
663
664    pub c_browser_info_label {
665        font-size: var!(font-sm);
666        font-weight: var!(font-weight-semibold);
667        color: "inherit";
668        opacity: "1";
669        text-transform: var!(text-transform-uppercase);
670        letter-spacing: var!(letter-spacing-wide);
671    }
672
673    pub c_browser_info_value {
674        font-size: var!(font-base);
675        color: "inherit";
676        word-break: "break-all";
677        font-family: var!(font-family-mono);
678    }
679
680    // ═══════════════════════════════════════════════════════════════════════════
681    // Keep-Alive Demo
682    // ═══════════════════════════════════════════════════════════════════════════
683
684    pub c_keep_alive_tab_bar {
685        display: "flex";
686        border-bottom: format!("{} solid {}", var!(border-width), var!(border));
687        margin-bottom: var!(gap-component);
688        gap: var!(gap-element);
689    }
690
691    pub c_keep_alive_tab_panel {
692        padding: format!("{} 0px", var!(gap-element));
693    }
694
695    pub c_keep_alive_panel_title {
696        margin-top: "0px";
697        color: var!(primary);
698        font-size: var!(font-md);
699        margin-bottom: var!(gap-element);
700    }
701
702    pub c_keep_alive_demo_text {
703        color: "inherit";
704        font-size: var!(font-base);
705        margin-bottom: var!(gap-component);
706    }
707
708    pub c_keep_alive_counter_display {
709        display: "flex";
710        justify-content: "center";
711        align-items: "center";
712        margin: format!("{} 0px", var!(space-xl));
713    }
714
715    pub c_keep_alive_counter_value {
716        font-size: var!(font-base);
717        font-weight: var!(font-weight-bold);
718        font-variant-numeric: "tabular-nums";
719        color: var!(primary);
720        text-align: "center";
721    }
722
723    pub c_keep_alive_counter_controls {
724        display: "flex";
725        flex-wrap: "wrap";
726        gap: format!("{}", var!(space-md));
727    }
728
729    pub c_keep_alive_form_group {
730        margin-bottom: var!(gap-component);
731    }
732
733    pub c_keep_alive_form_preview {
734        margin-top: var!(gap-component);
735        background: var!(muted);
736    }
737
738    pub c_keep_alive_preview_label {
739        font-size: var!(font-base);
740        font-weight: var!(font-weight-semibold);
741        color: var!(primary);
742        margin: format!("0px 0px {} 0px", var!(space-xs));
743    }
744
745    // ═══════════════════════════════════════════════════════════════════════════
746    // Binding Demo
747    // ═══════════════════════════════════════════════════════════════════════════
748
749    pub c_binding_child_box {
750        display: "flex";
751        flex-direction: "column";
752        gap: var!(gap-component);
753        margin-top: var!(gap-component);
754    }
755
756    pub c_binding_child_label {
757        font-size: var!(font-base);
758        font-weight: var!(font-weight-semibold);
759        color: var!(primary);
760        text-transform: var!(text-transform-uppercase);
761        letter-spacing: var!(letter-spacing-wide);
762    }
763
764    pub c_binding_parent_box {
765        display: "flex";
766        flex-direction: "column";
767        gap: var!(gap-component);
768        margin-top: var!(gap-component);
769    }
770
771    pub c_binding_section_title {
772        margin-top: var!(gap-component);
773        margin-bottom: var!(gap-element);
774        color: var!(primary);
775        font-size: var!(font-md);
776        font-weight: var!(font-weight-semibold);
777    }
778
779    pub c_binding_temp_converter {
780        display: "flex";
781        align-items: "flex-end";
782        gap: var!(gap-component);
783        flex-wrap: "wrap";
784        margin-top: var!(gap-component);
785    }
786
787    pub c_binding_temp_field {
788        flex: "1";
789        min-width: "120px";
790    }
791
792    pub c_binding_temp_arrow {
793        font-size: var!(font-xl);
794        font-weight: var!(font-weight-bold);
795        color: var!(primary);
796        // The row is `align-items: flex-end`, so the glyph would sit on the
797        // bottom edge of the input. The padding lifts it by half the
798        // difference between the input box and the line box of the glyph —
799        // a number no spacing token holds, because it is derived from the
800        // two heights rather than chosen.
801        padding-bottom: var!(space-sm-md);
802    }
803
804    pub c_binding_color_mixer {
805        margin-top: var!(gap-component);
806    }
807
808    pub c_binding_color_preview {
809        width: "100%";
810        height: "80px";
811        display: "flex";
812        align-items: "center";
813        justify-content: "center";
814        margin-bottom: var!(gap-component);
815    }
816
817    pub c_binding_color_hex {
818        font-family: var!(font-family-mono);
819        font-size: var!(font-xl);
820        font-weight: var!(font-weight-bold);
821        color: var!(primary-foreground);
822        letter-spacing: var!(letter-spacing-normal);
823    }
824
825    pub c_binding_slider_row {
826        display: "flex";
827        align-items: "center";
828        gap: format!("{}", var!(space-md));
829        margin-bottom: var!(space-sm);
830    }
831
832    pub c_binding_slider_label {
833        font-size: var!(font-base);
834        font-weight: var!(font-weight-bold);
835        min-width: var!(font-sm);
836    }
837
838    pub c_binding_slider {
839        flex: "1";
840        height: "24px";
841        padding: "0px";
842        cursor: "pointer";
843        -webkit-appearance: "none";
844        appearance: "none";
845        border: "none";
846        outline: "none";
847        ::-webkit-slider-runnable-track {
848            height: "6px";
849            background: format!("linear-gradient(to right, {} 0%, {} var(--value,50%), {} var(--value,50%), {} 100%)", var!(foreground), var!(foreground), var!(border), var!(border));
850            border-radius: var!(radius-xs);
851            border: "none";
852        }
853        ::-webkit-slider-thumb {
854            width: "20px";
855            height: "20px";
856            background: var!(background);
857            border: format!("2px solid {}", var!(primary));
858            border-radius: var!(radius-full);
859            cursor: "pointer";
860            -webkit-appearance: "none";
861            // The thumb is taller than the track it rides on, so the margin
862            // pulls it up until it sits centred on the track.
863            margin-top: format!("calc(({} - {}) / 2)", var!(space-xs-sm), var!(space-xl));
864        }
865        : active::-webkit-slider-thumb {
866            transform: "scale(0.92)";
867        }
868        ::-moz-range-track {
869            height: "6px";
870            background: format!("linear-gradient(to right, {} 0%, {} var(--value,50%), {} var(--value,50%), {} 100%)", var!(foreground), var!(foreground), var!(border), var!(border));
871            border-radius: var!(radius-xs);
872            border: "none";
873        }
874        ::-moz-range-thumb {
875            width: "20px";
876            height: "20px";
877            background: var!(background);
878            border: format!("2px solid {}", var!(primary));
879            border-radius: var!(radius-full);
880            cursor: "pointer";
881        }
882        : active::-moz-range-thumb {
883            transform: "scale(0.92)";
884        }
885    }
886
887    pub c_binding_slider_value {
888        font-size: var!(font-base);
889        font-weight: var!(font-weight-medium);
890        color: "inherit";
891        min-width: "32px";
892        text-align: "right";
893        font-family: var!(font-family-mono);
894    }
895
896    pub c_binding_typed_prop_value {
897        font-family: var!(font-family-mono);
898        font-size: var!(font-base);
899        font-weight: var!(font-weight-semibold);
900        color: var!(primary);
901        padding: format!("calc({} / 2) {}", var!(space-2xs), var!(space-sm));
902    }
903
904    pub c_binding_typed_prop_group {
905        display: "flex";
906        align-items: "center";
907        gap: var!(space-sm);
908    }
909
910    pub c_binding_typed_warning {
911        font-size: var!(font-base);
912        font-weight: var!(font-weight-medium);
913        color: var!(warning-foreground);
914        background: var!(warning);
915        margin-bottom: "0px";
916        border-radius: var!(radius-sm);
917    }
918
919    pub c_binding_form_label {
920        display: "block";
921        color: "inherit";
922        font-weight: var!(font-weight-medium);
923        font-size: var!(font-base);
924    }
925
926    pub c_binding_demo_text {
927        color: "inherit";
928        margin: "0px"
929    }
930
931    pub c_binding_compact_button {
932        display: "inline-flex";
933        justify-content: "center";
934        align-items: "center";
935        height: "42px";
936        padding: format!("0px {}", var!(space-md));
937        background: var!(primary);
938        color: var!(primary-foreground);
939        border: format!("{} solid {}", var!(border-width), var!(primary));
940        cursor: "pointer";
941        font-size: var!(font-sm);
942        font-weight: var!(font-weight-semibold);
943        outline: "none";
944        white-space: "nowrap";
945        user-select: "none";
946        -webkit-user-select: "none";
947        box-sizing: "border-box";
948        :hover {
949            background: var!(primary);
950        }
951        :focus-visible {
952            box-shadow: format!("0 0 0 calc({} + {}) {}", var!(ring-width), var!(ring-offset), var!(ring));
953        }
954        :active {
955            background: var!(primary);
956            color: var!(primary-foreground);
957            border-color: var!(primary);
958        }
959        border-radius: var!(radius-md);
960    }
961
962    // ═══════════════════════════════════════════════════════════════════════════
963    // Custom Attrs - Dynamic Style
964    // ═══════════════════════════════════════════════════════════════════════════
965
966    pub c_attrs_dynamic_demo(prop_key: &str, prop_value: &str) {
967        {
968            prop_key
969        }
970        : prop_value;
971        // No layout defaults: this class lives on a `<p>` whose own margin /
972        // spacing is controlled by its parent's typography rules, and pinning
973        // any colour here would shadow the user-supplied dynamic property.
974        // Users are expected to set `color` / `background` / `font-*` /
975        // etc. via the two CSS Property Key / Value inputs above; whatever
976        // they type becomes the literal CSS rule applied to the paragraph.
977    }
978
979    // ═══════════════════════════════════════════════════════════════════════════
980    // Dynamic Component Demo
981    // ═══════════════════════════════════════════════════════════════════════════
982
983    pub c_dynamic_component_tab_bar {
984        display: "flex";
985        flex-wrap: "wrap";
986        gap: var!(gap-element);
987        margin-bottom: var!(gap-component);
988    }
989
990    pub c_dynamic_component_panel {
991        display: "block";
992        min-height: var!(control-height-sm);
993        margin-top: var!(gap-component);
994    }
995
996    // ═══════════════════════════════════════════════════════════════════════════
997    // Sticky & CSS Effects Demo
998    // ═══════════════════════════════════════════════════════════════════════════
999
1000    // ═══════════════════════════════════════════════════════════════════════════
1001    // Home Page — Section
1002    // ═══════════════════════════════════════════════════════════════════════════
1003
1004    pub c_home {
1005        position: "relative";
1006        text-align: "center";
1007        margin-bottom: var!(space-xl);
1008        flex: "1";
1009        display: "flex";
1010        flex-direction: "column";
1011        justify-content: "center";
1012        @media ((max-width: 767px)) {
1013            margin-bottom: var!(space-lg);
1014            flex: "0 0 auto";
1015            justify-content: "flex-start";
1016        }
1017    }
1018
1019    pub c_home_content {
1020        position: "relative";
1021        z-index: "1";
1022    }
1023
1024    pub c_home_badge_row {
1025        display: "inline-flex";
1026        align-items: "center";
1027        // A base rule resets this to `flex`, so the row spans the full column
1028        // and `text-align: center` on the parent no longer centres it — a flex
1029        // child is placed by its own alignment. Without this the badges sit at
1030        // the left edge while the centred title below them does not.
1031        justify-content: "center";
1032        gap: var!(space-sm);
1033        margin-bottom: var!(space-md);
1034    }
1035
1036    pub c_home_badge {
1037        // The wrapping-atom recipe (§7), like the tag and the badge.
1038        display: "inline-block";
1039        vertical-align: "middle";
1040        text-align: "center";
1041        line-height: "1";
1042        box-sizing: "border-box";
1043        padding: format!("{} {}", var!(space-xs), var!(space-sm));
1044        // Text on a coloured surface takes that surface's own foreground role:
1045        // `primary` is a brand colour, not a readable one, and several schemes
1046        // (linear, stripe) sit below 4.5:1 against `accent`.
1047        color: var!(accent-foreground);
1048        background: var!(accent);
1049        font-size: var!(font-xs);
1050        font-weight: var!(font-weight-semibold);
1051        letter-spacing: var!(letter-spacing-wide);
1052        // The border keeps the brand colour — it is a 1px line, so 3:1 applies.
1053        border: format!("{} solid {}", var!(border-width), var!(primary));
1054    }
1055
1056    pub c_home_title {
1057        font-size: var!(font-5xl);
1058        font-weight: var!(font-weight-bold);
1059        letter-spacing: var!(letter-spacing-tight);
1060        margin: "0px";
1061        color: var!(foreground);
1062        margin-bottom: var!(space-xs);
1063        @media ((max-width: 767px)) {
1064            font-size: var!(font-4xl);
1065        }
1066    }
1067
1068    pub c_home_subtitle {
1069        font-size: var!(font-lg);
1070        color: var!(foreground);
1071        margin: "0px auto";
1072        max-width: "520px";
1073        margin-bottom: var!(space-lg);
1074        @media ((max-width: 767px)) {
1075            font-size: var!(font-base);
1076        }
1077    }
1078
1079    pub c_home_actions {
1080        display: "flex";
1081        gap: var!(space-md);
1082        justify-content: "center";
1083        flex-wrap: "wrap";
1084        // Below the breakpoint the actions become equal-width rows: the two
1085        // labels differ in length, so a content-sized wrap leaves the shorter
1086        // button visibly narrower and the row reads as misaligned.
1087        @media ((max-width: 767px)) {
1088            flex-wrap: "nowrap";
1089            align-items: "stretch";
1090        }
1091    }
1092
1093    pub c_home_btn_primary {
1094        display: "inline-flex";
1095        justify-content: "center";
1096        align-items: "center";
1097        gap: var!(space-sm);
1098        // A button is a nowrap element (§7).
1099        white-space: "nowrap";
1100        padding: format!("{} {}", var!(space-sm), var!(space-2xl));
1101        background: var!(primary);
1102        color: var!(primary-foreground);
1103        font-size: var!(font-base);
1104        font-weight: var!(font-weight-semibold);
1105        text-decoration: "none";
1106        border: "1.5px solid transparent";
1107        cursor: "pointer";
1108        letter-spacing: var!(letter-spacing-normal);
1109        vertical-align: "middle";
1110        min-height: var!(control-height-sm);
1111        // Hover changes paint only; the press keeps its separate feedback.
1112        transition: format!(
1113        "background-color {} {}, border-color {} {}, transform {} {}",
1114        var!(duration-fast),
1115        var!(ease-out),
1116        var!(duration-fast),
1117        var!(ease-out),
1118        var!(duration-fast),
1119        var!(ease-out)
1120        );
1121        @media ((max-width: 767px)) {
1122            flex: "1 1 0px";
1123            min-width: "0px";
1124        }
1125        :hover {
1126            background: var!(primary-hover);
1127            color: var!(primary-foreground);
1128            border-color: "transparent";
1129        }
1130        :focus-visible {
1131            box-shadow: format!("0 0 0 calc({} + {}) {}", var!(ring-width), var!(ring-offset), var!(ring));
1132        }
1133        :active {
1134            background: var!(primary);
1135            color: var!(primary-foreground);
1136            border-color: "transparent";
1137            transform: format!("translateY(0px) scale({})", var!(press-scale));
1138        }
1139        border-radius: var!(radius-sm);
1140    }
1141
1142    pub c_home_btn_secondary {
1143        display: "inline-flex";
1144        justify-content: "center";
1145        align-items: "center";
1146        gap: var!(space-sm);
1147        // A button is a nowrap element (§7).
1148        white-space: "nowrap";
1149        padding: format!("{} {}", var!(space-sm), var!(space-2xl));
1150        color: var!(primary);
1151        font-size: var!(font-base);
1152        font-weight: var!(font-weight-semibold);
1153        text-decoration: "none";
1154        border: format!("1.5px solid {}", var!(primary));
1155        cursor: "pointer";
1156        letter-spacing: var!(letter-spacing-normal);
1157        vertical-align: "middle";
1158        min-height: var!(control-height-sm);
1159        // Hover keeps geometry fixed while press feedback remains independent.
1160        transition: format!(
1161        "background-color {} {}, border-color {} {}, transform {} {}",
1162        var!(duration-fast),
1163        var!(ease-out),
1164        var!(duration-fast),
1165        var!(ease-out),
1166        var!(duration-fast),
1167        var!(ease-out)
1168        );
1169        @media ((max-width: 767px)) {
1170            flex: "1 1 0px";
1171            min-width: "0px";
1172        }
1173        :hover {
1174            background: var!(secondary);
1175            color: var!(secondary-foreground);
1176            border-color: var!(input);
1177        }
1178        :focus-visible {
1179            box-shadow: format!("0 0 0 calc({} + {}) {}", var!(ring-width), var!(ring-offset), var!(ring));
1180        }
1181        :active {
1182            background: "transparent";
1183            color: var!(primary);
1184            border-color: var!(primary);
1185            transform: format!("translateY(0px) scale({})", var!(press-scale));
1186        }
1187        border-radius: var!(radius-sm);
1188    }
1189
1190    // ═══════════════════════════════════════════════════════════════════════════
1191    // Home Page — Stats Row
1192    // ═══════════════════════════════════════════════════════════════════════════
1193
1194    pub c_home_stats {
1195        display: "grid";
1196        grid-template-columns: "repeat(4, minmax(0px, 1fr))";
1197        gap: var!(space-md);
1198        margin-bottom: var!(space-xl);
1199        @media ((max-width: 767px)) {
1200            grid-template-columns: "repeat(2, 1fr)";
1201            gap: var!(space-sm);
1202        }
1203    }
1204
1205    pub c_home_stat_card {
1206        display: "flex";
1207        flex-direction: "column";
1208        align-items: "center";
1209        justify-content: "center";
1210        gap: var!(space-xs);
1211        border-radius: var!(radius-xl);
1212    }
1213
1214    pub c_home_stat_icon {
1215        font-size: var!(font-2xl);
1216    }
1217
1218    pub c_home_stat_value {
1219        font-size: var!(font-xl);
1220        font-weight: var!(font-weight-bold);
1221        color: var!(foreground);
1222        letter-spacing: var!(letter-spacing-normal);
1223    }
1224
1225    pub c_home_stat_label {
1226        font-size: var!(font-sm);
1227        color: var!(muted-foreground);
1228        font-weight: var!(font-weight-medium);
1229    }
1230
1231    // ═══════════════════════════════════════════════════════════════════════════
1232    // Home Page — Section & Feature Cards
1233    // ═══════════════════════════════════════════════════════════════════════════
1234
1235    pub c_home_section_title {
1236        font-size: var!(font-2xl);
1237        font-weight: var!(font-weight-bold);
1238        color: var!(foreground);
1239        margin: "0px";
1240        margin: format!("{} 0px", var!(gap-component));
1241        letter-spacing: var!(letter-spacing-tight);
1242    }
1243
1244    pub c_home_section_desc {
1245        font-size: var!(font-base);
1246        color: var!(foreground);
1247        margin: "0px";
1248        margin-bottom: var!(space-2xl);
1249    }
1250
1251    pub c_home_feature_grid {
1252        display: "grid";
1253        grid-template-columns: "repeat(2, minmax(0px, 1fr))";
1254        // The grid owns sibling spacing; cards keep their intrinsic height and insets.
1255        align-items: "start";
1256        gap: var!(page-block-gap);
1257        @media ((max-width: 767px)) {
1258            gap: var!(page-block-gap-mobile);
1259            grid-template-columns: "1fr";
1260        }
1261    }
1262
1263    pub c_feature_card {
1264        display: "flex";
1265        flex-direction: "column";
1266        gap: var!(space-sm);
1267        padding: "0px";
1268        overflow: "hidden";
1269        border-radius: var!(radius-xl);
1270    }
1271
1272    pub c_feature_header {
1273        display: "flex";
1274        align-items: "center";
1275        gap: var!(space-sm);
1276    }
1277
1278    pub c_feature_icon {
1279        font-size: var!(font-2xl);
1280        display: "flex";
1281        align-items: "center";
1282        justify-content: "center";
1283        line-height: "1";
1284        flex-shrink: "0";
1285    }
1286
1287    pub c_feature_name {
1288        font-size: var!(font-lg);
1289        font-weight: var!(font-weight-semibold);
1290        color: var!(foreground);
1291        margin: "0px";
1292        overflow: "hidden";
1293        text-overflow: "ellipsis";
1294        white-space: "nowrap";
1295    }
1296
1297    pub c_feature_desc {
1298        font-size: var!(font-sm);
1299        color: var!(foreground);
1300        margin: "0px";
1301    }
1302
1303    pub c_info_row {
1304        display: "flex";
1305        align-items: "center";
1306        gap: var!(space-md);
1307        padding: format!("{} 0", var!(space-sm));
1308        overflow: "hidden";
1309    }
1310
1311    pub c_info_label {
1312        font-size: var!(font-sm);
1313        font-weight: var!(font-weight-medium);
1314        color: var!(muted-foreground);
1315        min-width: "72px";
1316        flex-shrink: "0";
1317        letter-spacing: var!(letter-spacing-normal);
1318    }
1319
1320    pub c_info_value {
1321        c_text_ellipsis();
1322        font-size: var!(font-base);
1323        font-weight: var!(font-weight-semibold);
1324        color: var!(foreground);
1325        font-family: var!(font-family-mono);
1326        flex: "1";
1327    }
1328
1329    pub c_info_link {
1330        c_text_ellipsis();
1331        font-size: var!(font-base);
1332        font-weight: var!(font-weight-semibold);
1333        color: var!(primary);
1334        font-family: var!(font-family-mono);
1335        flex: "1";
1336        text-decoration: "none";
1337        transition: format!("opacity {} {}", var!(duration-fast), var!(ease-out));
1338        :hover {
1339            opacity: "1";
1340        }
1341    }
1342
1343    pub c_spinner {
1344        width: "40px";
1345        height: "40px";
1346        border: format!("4px solid {}", var!(muted));
1347        border-top: format!("4px solid {}", var!(primary));
1348        border-right: format!("4px solid {}", var!(primary));
1349        border-bottom: format!("4px solid {}", var!(primary));
1350        border-radius: var!(radius-full);
1351        flex-shrink: "0";
1352        animation: "euv-spin 0.8s linear infinite";
1353    }
1354
1355    pub c_loading_overlay(background: &str) {
1356        position: "absolute";
1357        top: "0";
1358        left: "0";
1359        width: "100%";
1360        height: "100%";
1361        display: "flex";
1362        flex-direction: "column";
1363        align-items: "center";
1364        justify-content: "center";
1365        gap: var!(gap-component);
1366        background: background;
1367        z-index: "5";
1368        box-sizing: "border-box";
1369    }
1370
1371    pub c_error_container {
1372        display: "flex";
1373        align-items: "center";
1374        gap: var!(gap-element);
1375        margin-top: var!(gap-component);
1376        box-sizing: "border-box";
1377        border-radius: var!(radius-lg);
1378    }
1379
1380    pub c_error_icon {
1381        width: "20px";
1382        height: "20px";
1383        display: "flex";
1384        align-items: "center";
1385        justify-content: "center";
1386        flex-shrink: "0";
1387        color: var!(destructive);
1388        font-size: var!(font-sm);
1389        font-weight: var!(font-weight-bold);
1390    }
1391
1392    pub c_error_text {
1393        color: var!(destructive);
1394        font-size: var!(font-base);
1395    }
1396
1397    pub c_data_box {
1398        margin: format!("{} 0px", var!(gap-component));
1399        box-sizing: "border-box";
1400        border-radius: var!(radius-sm);
1401    }
1402
1403    pub c_data_pre {
1404        color: var!(foreground);
1405        font-size: var!(font-base);
1406        margin: "0px";
1407        white-space: "pre-wrap";
1408        word-break: "break-all";
1409        font-family: var!(font-family-mono);
1410    }
1411
1412    pub c_fetch_hint {
1413        color: "inherit";
1414        opacity: "1";
1415        font-size: var!(font-base);
1416        margin-bottom: var!(gap-component);
1417    }
1418
1419    // ═══════════════════════════════════════════════════════════════════════════
1420    // Log / Console Display
1421    // ═══════════════════════════════════════════════════════════════════════════
1422
1423    pub c_log_container {
1424        font-family: var!(font-family-mono);
1425        font-size: var!(font-base);
1426        margin-top: "0px";
1427        color: var!(foreground);
1428    }
1429
1430    pub c_log_item {
1431        padding: format!("{} 0px", var!(space-sm));
1432        font-size: var!(font-base);
1433        color: var!(foreground);
1434        border-radius: var!(radius-sm);
1435    }
1436
1437    // ═══════════════════════════════════════════════════════════════════════════
1438    // Page Banner (unified header with emoji icon)
1439    // ═══════════════════════════════════════════════════════════════════════════
1440
1441    pub(crate) c_page {
1442        position: "relative";
1443        text-align: "center";
1444        box-sizing: "border-box";
1445    }
1446
1447    pub(crate) c_page_glow {
1448        position: "absolute";
1449        top: "-50%";
1450        left: "50%";
1451        transform: "translateX(-50%)";
1452        width: "400px";
1453        max-width: "100%";
1454        height: "400px";
1455        pointer-events: "none";
1456    }
1457
1458    pub(crate) c_page_content {
1459        position: "relative";
1460        z-index: "1";
1461    }
1462
1463    pub(crate) c_page_icon {
1464        font-size: "36px";
1465        padding-bottom: var!(space-md);
1466        @media ((max-width: 767px)) {
1467            font-size: "40px";
1468        }
1469    }
1470
1471    pub(crate) c_page_title {
1472        font-size: var!(font-4xl);
1473        font-weight: var!(font-weight-bold);
1474        letter-spacing: var!(letter-spacing-tight);
1475        margin: "0px";
1476        color: var!(foreground);
1477        margin-bottom: var!(space-sm);
1478        @media ((max-width: 767px)) {
1479            font-size: var!(font-3xl);
1480        }
1481    }
1482
1483    pub(crate) c_page_subtitle {
1484        font-size: var!(font-lg);
1485        color: var!(muted-foreground);
1486        margin: "0px auto";
1487        margin-bottom: var!(space-sm);
1488        max-width: "560px";
1489        opacity: "1";
1490        @media ((max-width: 767px)) {
1491            font-size: var!(font-base);
1492        }
1493    }
1494
1495    // ═══════════════════════════════════════════════════════════════════════════
1496    // Home Page
1497    // ═══════════════════════════════════════════════════════════════════════════
1498
1499    pub(crate) c_text_ellipsis {
1500        overflow: "hidden";
1501        text-overflow: "ellipsis";
1502        white-space: "nowrap";
1503    }
1504
1505    // ═══════════════════════════════════════════════════════════════════════════
1506    // Async / Loading States
1507    // ═══════════════════════════════════════════════════════════════════════════
1508
1509    pub(crate) c_loading_container {
1510        display: "flex";
1511        align-items: "center";
1512        justify-content: "center";
1513        gap: var!(gap-component);
1514        margin: format!("{} 0px", var!(gap-component));
1515        box-sizing: "border-box";
1516    }
1517
1518    pub(crate) c_loading_text_col {
1519        display: "flex";
1520        flex-direction: "column";
1521        gap: var!(space-xs);
1522    }
1523
1524    pub(crate) c_loading_title {
1525        color: var!(foreground);
1526        font-size: var!(font-md);
1527        font-weight: var!(font-weight-medium);
1528    }
1529
1530    pub(crate) c_loading_subtitle {
1531        color: var!(muted-foreground);
1532        font-size: var!(font-base);
1533    }
1534}