galb-dai commited on
Commit
e5e5305
·
1 Parent(s): 0600810
app.py CHANGED
@@ -6,15 +6,14 @@ from apscheduler.schedulers.background import BackgroundScheduler
6
  from gradio_leaderboard import Leaderboard, SelectColumns
7
  from huggingface_hub import whoami
8
 
9
- # NOTE: split WHAT_IS_F1_HTML into top/bottom so we can insert a Gradio-based tabbed element & video between them.
10
- from src.about import (
11
- CITATION_BUTTON_LABEL,
12
- CITATION_BUTTON_TEXT,
13
- EVALUATION_QUEUE_TEXT,
14
- WHAT_IS_F1_HTML_BOTTOM_TAIL,
15
- WHAT_IS_F1_HTML_BOTTOM_TOP,
16
- WHAT_IS_F1_HTML_TOP,
17
- )
18
  from src.datamodel.data import F1Data
19
  from src.display.css_html_js import custom_css
20
  from src.display.formatting import styled_error
@@ -211,10 +210,10 @@ with blocks:
211
 
212
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
213
  with gr.TabItem("What is FormulaOne", id=0, elem_id="what-is-tab"):
214
- # Top content
215
  gr.HTML(WHAT_IS_F1_HTML_TOP)
216
 
217
- # Examples (kept inside a centered container; content itself 730px wide)
218
  with gr.Group(elem_id="f1-examples", elem_classes=["f1-container"]):
219
  gr.HTML(
220
  '<div class="f1-tabs-body"><div class="f1-examples-chip">Examples of FormulaOne problems</div></div>'
@@ -263,27 +262,50 @@ with blocks:
263
  )
264
  tab_radio.change(_select_example_tab, inputs=tab_radio, outputs=[md_warmup, md_tier1, md_tier2])
265
 
266
- # Bottom content (part 1 up to where the video goes)
267
- gr.HTML(WHAT_IS_F1_HTML_BOTTOM_TOP)
 
 
 
 
 
 
 
 
268
 
269
- # Embed video via Gradio so it renders reliably
270
  gr.Video(
271
  "assets/DominatingSetAnimation.mp4",
272
- autoplay=True,
273
- loop=True,
274
  show_label=False,
275
  interactive=False,
276
  elem_classes=["f1-video"],
277
  )
278
- # The caption (centered, dark; styled in CSS)
279
  gr.HTML(
280
- '<div class="f1-figcaption">Animation showing the design of a compressed dynamic programming state-space.</div>'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  )
282
 
283
- # Remaining content
284
- gr.HTML(WHAT_IS_F1_HTML_BOTTOM_TAIL)
285
 
286
- # Rename tab to "Leaderboard" and keep it at 800px max-width
287
  with gr.TabItem("Leaderboard", elem_id="formulaone-leaderboard-tab-table", id=1):
288
  gr.Markdown(
289
  """
 
6
  from gradio_leaderboard import Leaderboard, SelectColumns
7
  from huggingface_hub import whoami
8
 
9
+ # HTML is split so we can inject Gradio media (images/video) where needed.
10
+ from src.about import WHAT_IS_F1_HTML_AFTER_TIER1FIG_TAIL # tail after Tier1 fig
11
+ from src.about import WHAT_IS_F1_HTML_AFTER_VIDEO # text immediately after the video
12
+ from src.about import WHAT_IS_F1_HTML_AFTER_WARMUPFIG # text between warmup/tier1 figs
13
+ from src.about import WHAT_IS_F1_HTML_BOTTOM_A # up to before first figure
14
+ from src.about import WHAT_IS_F1_HTML_BOTTOM_B # after first figure, before video
15
+ from src.about import WHAT_IS_F1_HTML_EVAL_BEFORE_WARMUPFIG # evaluation section up to before Warmup fig
16
+ from src.about import CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, EVALUATION_QUEUE_TEXT, WHAT_IS_F1_HTML_TOP
 
17
  from src.datamodel.data import F1Data
18
  from src.display.css_html_js import custom_css
19
  from src.display.formatting import styled_error
 
210
 
211
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
212
  with gr.TabItem("What is FormulaOne", id=0, elem_id="what-is-tab"):
213
+ # Top content and categories table
214
  gr.HTML(WHAT_IS_F1_HTML_TOP)
215
 
216
+ # Examples (centered; inner width 730px via CSS)
217
  with gr.Group(elem_id="f1-examples", elem_classes=["f1-container"]):
218
  gr.HTML(
219
  '<div class="f1-tabs-body"><div class="f1-examples-chip">Examples of FormulaOne problems</div></div>'
 
262
  )
263
  tab_radio.change(_select_example_tab, inputs=tab_radio, outputs=[md_warmup, md_tier1, md_tier2])
264
 
265
+ # Bottom content pieces interleaved with real Gradio media
266
+ gr.HTML(WHAT_IS_F1_HTML_BOTTOM_A)
267
+
268
+ # Figure 1: bag_modifications.png (use gr.Image)
269
+ gr.Image("assets/bag_modifications.png", show_label=False, elem_classes=["f1-image"])
270
+ gr.HTML(
271
+ '<div class="f1-figcaption">An illustration of local modifications to bags: Introduce, Forget, and Join.</div>'
272
+ )
273
+
274
+ gr.HTML(WHAT_IS_F1_HTML_BOTTOM_B)
275
 
276
+ # Video (no autoplay/loop), smaller gap to caption via CSS
277
  gr.Video(
278
  "assets/DominatingSetAnimation.mp4",
279
+ autoplay=False,
280
+ loop=False,
281
  show_label=False,
282
  interactive=False,
283
  elem_classes=["f1-video"],
284
  )
 
285
  gr.HTML(
286
+ '<div class="f1-figcaption f1-figcaption-video">Animation showing the design of a compressed dynamic programming state-space.</div>'
287
+ )
288
+
289
+ gr.HTML(WHAT_IS_F1_HTML_AFTER_VIDEO)
290
+
291
+ # Evaluation: Warmup figure
292
+ gr.HTML(WHAT_IS_F1_HTML_EVAL_BEFORE_WARMUPFIG)
293
+ gr.Image("assets/warmup_performance.png", show_label=False, elem_classes=["f1-image"])
294
+ gr.HTML('<div class="f1-figcaption">Performance of frontier models on the FormulaOne-Warmup dataset.</div>')
295
+
296
+ # Between warmup and tier1 figs
297
+ gr.HTML(WHAT_IS_F1_HTML_AFTER_WARMUPFIG)
298
+
299
+ # Tier 1 figure with corrected caption text
300
+ gr.Image("assets/tier1_performance.png", show_label=False, elem_classes=["f1-image"])
301
+ gr.HTML(
302
+ '<div class="f1-figcaption">Performance of frontier reasoning models on the Tier 1 of FormulaOne.</div>'
303
  )
304
 
305
+ # Tail after Tier 1 fig
306
+ gr.HTML(WHAT_IS_F1_HTML_AFTER_TIER1FIG_TAIL)
307
 
308
+ # Rename tab to "Leaderboard" and cap at 800px width
309
  with gr.TabItem("Leaderboard", elem_id="formulaone-leaderboard-tab-table", id=1):
310
  gr.Markdown(
311
  """
assets/banner.png DELETED

Git LFS Details

  • SHA256: c15fba8c98bceb565e07dbd4dca6e9bb4d9210e54e261f3549d2bc3d71f4cfef
  • Pointer size: 130 Bytes
  • Size of remote file: 77.9 kB
assets/banner_2.png DELETED

Git LFS Details

  • SHA256: c47df07e57ce52cbd0ce2f6eae3d8e10e42693e988f085e223885c257c4ae0ad
  • Pointer size: 131 Bytes
  • Size of remote file: 166 kB
assets/banner_backup.png DELETED

Git LFS Details

  • SHA256: 9cfbe4b89e6dd579d34efcff88ac1189120be32e01dfe305ffaa1230ed05beab
  • Pointer size: 131 Bytes
  • Size of remote file: 217 kB
assets/banner_odd.png DELETED

Git LFS Details

  • SHA256: f3d932a00a57b32de098cbd044ab9cfe990c06e4d7a49f1b5504273e18bf36a2
  • Pointer size: 131 Bytes
  • Size of remote file: 975 kB
src/about.py CHANGED
@@ -14,11 +14,12 @@ WHAT_IS_F1_HTML_TOP = f"""
14
 
15
  <p class="mb-4 f1-p"><strong>FormulaOne</strong> consists of 220 novel dynamic programming problems over graphs. The problems are organised into three categories, ranging from moderate difficulty and all the way up to research-level.</p>
16
 
 
17
  <div class="f1-grid-wrap" role="region" aria-label="FormulaOne categories">
18
  <div class="f1-grid-table" role="table">
19
  <div class="f1-grid-row f1-grid-head" role="row">
20
  <div class="f1-grid-cell" role="columnheader">Category</div>
21
- <div class="f1-grid-cell" role="columnheader">Size</div>
22
  <div class="f1-grid-cell" role="columnheader">Description</div>
23
  </div>
24
  <div class="f1-grid-row" role="row">
@@ -42,7 +43,8 @@ WHAT_IS_F1_HTML_TOP = f"""
42
  </div>
43
  """
44
 
45
- WHAT_IS_F1_HTML_BOTTOM_TOP = """
 
46
  <div class="f1-container">
47
  <section>
48
  <p class="mb-4 f1-p">The latter category is incredibly demanding, requiring resolution of many points of uncertainty, and involving an array of reasoning steps, including topological and geometric insight, knowledge of mathematical domains such as extremal graph theory and logic, combinatorial considerations, precise implementation, and more.</p>
@@ -56,15 +58,15 @@ WHAT_IS_F1_HTML_BOTTOM_TOP = """
56
  “For every sufficiently tree-like graph, any problem definable in an expressive formal logic — Monadic Second-Order (MSO) logic — can be solved by a dynamic programming algorithm that operates in time linear in the order of the graph.”
57
  </blockquote>
58
  <p class="f1-p">The key is to use a structure known as a tree decomposition, which organises the graph’s vertices into a series of overlapping sets, or “bags”, that are themselves arranged in a tree.</p>
59
- <figure class="f1-figure">
60
- <img src="assets/bag_modifications.png" alt="An illustration of local modifications to bags (dashed boxes)" class="max-w-full md:max-w-2xl mx-auto rounded-lg shadow-md">
61
- <figcaption class="f1-figcaption">An illustration of local modifications to bags: Introduce, Forget, and Join.</figcaption>
62
- </figure>
63
  <p class="mb-4 f1-p">An algorithm can then traverse this tree of bags, solving the problem piece by piece using dynamic programming. This process involves designing a “state” that summarises all necessary information about the partial solution within a bag, and then defining how this state transforms as vertices are introduced, forgotten, or bags are merged.</p>
64
- <!-- VIDEO INSERTED HERE VIA gr.Video IN app.py -->
65
  """
66
 
67
- WHAT_IS_F1_HTML_BOTTOM_TAIL = """
68
  <p class="f1-p">The deceptive simplicity of the problem statements belies the <strong>extraordinary difficulty</strong> of discovering the correct dynamic programming solution. This process is riddled with subtle combinatorial and logical pitfalls, demanding a profound understanding of the problem’s underlying structure. For a detailed walkthrough of the fifteen interdependent reasoning steps required to solve a single hard problem &mdash; <code>Maximal-Cluster-Graph</code> &mdash; <a href="https://arxiv.org/pdf/2507.13337#appendix.A" target="_blank" rel="noopener noreferrer" class="f1-a">see the appendix of our paper</a>.</p>
69
  </section>
70
 
@@ -82,21 +84,20 @@ WHAT_IS_F1_HTML_BOTTOM_TAIL = """
82
 
83
  <h2 class="f1-h2">Model Accuracy</h2>
84
  <p class="mb-4 f1-p">On the <strong>FormulaOne-Warmup</strong> problems, frontier models perform reasonably well. This confirms they have a foundational capability for these types of algorithmic tasks.</p>
85
- <figure class="f1-figure">
86
- <img src="/file=assets/warmup_performance.png" alt="Plot showing model performance on FormulaOne-Warmup" class="max-w-full md:max-w-2xl mx-auto rounded-lg shadow-md">
87
- <figcaption class="f1-figcaption">Performance of frontier models on the FormulaOne-Warmup dataset.</figcaption>
88
- </figure>
89
  <p class="mb-4 f1-p">However, as the reasoning depth increases in <strong>Tier 1</strong>, and solutions require the discovery and integration of novel and more complex state representations, model performance drops off sharply.</p>
90
- <figure class="f1-figure">
91
- <img src="/file=assets/tier1_performance.png" alt="Plot showing model performance on Tier 1" class="max-w-full md:max-w-2xl mx-auto rounded-lg shadow-md">
92
- <figcaption class="f1-figcaption">Performance of frontier reasoning models on the FormulaOne dataset.</figcaption>
93
- </figure>
94
  <p class="f1-p">This trend culminates in <strong>Tier 2</strong>, where the difficulty is characteristic of exploratory research problems. On this set of 20 problems, no current frontier model solves even a single one. This result starkly illustrates the gap that remains between high performance on existing benchmarks and the deep algorithmic reasoning required for truly complex problems.</p>
95
  </section>
96
  </div>
97
  """
98
 
99
-
100
  EVALUATION_QUEUE_TEXT = """
101
  ## Submitting to the FormulaOne Leaderboard
102
 
 
14
 
15
  <p class="mb-4 f1-p"><strong>FormulaOne</strong> consists of 220 novel dynamic programming problems over graphs. The problems are organised into three categories, ranging from moderate difficulty and all the way up to research-level.</p>
16
 
17
+ <!-- Clean, centered "table" using a single grid -->
18
  <div class="f1-grid-wrap" role="region" aria-label="FormulaOne categories">
19
  <div class="f1-grid-table" role="table">
20
  <div class="f1-grid-row f1-grid-head" role="row">
21
  <div class="f1-grid-cell" role="columnheader">Category</div>
22
+ <div class="f1-grid-cell" role="columnheader">Number of Problems</div>
23
  <div class="f1-grid-cell" role="columnheader">Description</div>
24
  </div>
25
  <div class="f1-grid-row" role="row">
 
43
  </div>
44
  """
45
 
46
+ # Bottom is split so we can insert real Gradio media (images/video) from app.py.
47
+ WHAT_IS_F1_HTML_BOTTOM_A = """
48
  <div class="f1-container">
49
  <section>
50
  <p class="mb-4 f1-p">The latter category is incredibly demanding, requiring resolution of many points of uncertainty, and involving an array of reasoning steps, including topological and geometric insight, knowledge of mathematical domains such as extremal graph theory and logic, combinatorial considerations, precise implementation, and more.</p>
 
58
  “For every sufficiently tree-like graph, any problem definable in an expressive formal logic — Monadic Second-Order (MSO) logic — can be solved by a dynamic programming algorithm that operates in time linear in the order of the graph.”
59
  </blockquote>
60
  <p class="f1-p">The key is to use a structure known as a tree decomposition, which organises the graph’s vertices into a series of overlapping sets, or “bags”, that are themselves arranged in a tree.</p>
61
+ <!-- bag_modifications figure inserted via gr.Image in app.py -->
62
+ """
63
+
64
+ WHAT_IS_F1_HTML_BOTTOM_B = """
65
  <p class="mb-4 f1-p">An algorithm can then traverse this tree of bags, solving the problem piece by piece using dynamic programming. This process involves designing a “state” that summarises all necessary information about the partial solution within a bag, and then defining how this state transforms as vertices are introduced, forgotten, or bags are merged.</p>
66
+ <!-- Video inserted via gr.Video in app.py -->
67
  """
68
 
69
+ WHAT_IS_F1_HTML_AFTER_VIDEO = """
70
  <p class="f1-p">The deceptive simplicity of the problem statements belies the <strong>extraordinary difficulty</strong> of discovering the correct dynamic programming solution. This process is riddled with subtle combinatorial and logical pitfalls, demanding a profound understanding of the problem’s underlying structure. For a detailed walkthrough of the fifteen interdependent reasoning steps required to solve a single hard problem &mdash; <code>Maximal-Cluster-Graph</code> &mdash; <a href="https://arxiv.org/pdf/2507.13337#appendix.A" target="_blank" rel="noopener noreferrer" class="f1-a">see the appendix of our paper</a>.</p>
71
  </section>
72
 
 
84
 
85
  <h2 class="f1-h2">Model Accuracy</h2>
86
  <p class="mb-4 f1-p">On the <strong>FormulaOne-Warmup</strong> problems, frontier models perform reasonably well. This confirms they have a foundational capability for these types of algorithmic tasks.</p>
87
+ <!-- warmup_performance figure inserted via gr.Image in app.py -->
88
+ """
89
+
90
+ WHAT_IS_F1_HTML_AFTER_WARMUPFIG = """
91
  <p class="mb-4 f1-p">However, as the reasoning depth increases in <strong>Tier 1</strong>, and solutions require the discovery and integration of novel and more complex state representations, model performance drops off sharply.</p>
92
+ <!-- tier1_performance figure inserted via gr.Image in app.py -->
93
+ """
94
+
95
+ WHAT_IS_F1_HTML_AFTER_TIER1FIG_TAIL = """
96
  <p class="f1-p">This trend culminates in <strong>Tier 2</strong>, where the difficulty is characteristic of exploratory research problems. On this set of 20 problems, no current frontier model solves even a single one. This result starkly illustrates the gap that remains between high performance on existing benchmarks and the deep algorithmic reasoning required for truly complex problems.</p>
97
  </section>
98
  </div>
99
  """
100
 
 
101
  EVALUATION_QUEUE_TEXT = """
102
  ## Submitting to the FormulaOne Leaderboard
103
 
src/display/css_html_js.py CHANGED
@@ -6,143 +6,85 @@ custom_css = """
6
  --f1-bg: #ffffff;
7
  --f1-bg-muted: #f9fafb;
8
 
9
- /* Disable Gradio chrome that was bleeding into the examples block */
10
  --block-border-color: transparent !important;
11
  --background-fill-primary: transparent !important;
12
  }
13
 
14
- /* Readable width everywhere */
15
  .f1-container { max-width: 800px; margin: 0 auto; padding: 0 16px; }
16
  .markdown-text { font-size: 16px !important; max-width: 800px; margin: 0 auto; }
17
  #what-is-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
 
18
 
19
- /* Examples wrapper stays centered, content width 730px */
20
- #f1-examples { max-width: 730px; margin: 0 auto; }
21
-
22
- /* Body text */
23
- .f1-p, .f1-li {
24
- line-height: 1.75;
25
- color: #374151;
26
- text-wrap: pretty;
27
- overflow-wrap: break-word;
28
- hyphens: auto;
29
- }
30
 
31
  /* Headings */
32
  .f1-h1 { font-weight: 700; font-size: 2.25rem; line-height: 2.5rem; color: var(--f1-text); text-align: center; margin-bottom: 1.25rem !important; }
33
- .f1-h2 {
34
- font-weight: 700;
35
- border-bottom: 1px solid var(--f1-border);
36
- padding-bottom: 0.45rem;
37
- margin-top: 1.75rem;
38
- margin-bottom: 0.9rem;
39
- color: var(--f1-text);
40
- font-size: 1.5rem;
41
- line-height: 2rem;
42
- }
43
 
44
  /* Links */
45
  .f1-a { color: #2563eb; text-decoration: none; font-weight: 500; }
46
  .f1-a:hover { text-decoration: underline; }
47
 
48
- /* Captions, problem name */
49
- .f1-figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: #111827; text-align: center; }
 
50
 
51
- /* Problem name: guarantee center on first render; force bg color for <code> */
 
52
  #f1-examples .f1-problem-markdown .markdown p.f1-problem-name { text-align: center !important; margin: 0 0 8px 0; }
 
53
  #f1-examples .f1-problem-markdown .markdown p.f1-problem-name code {
54
- display: inline-block;
55
- background: #f9fafb !important; /* requested override; bypasses --code-background-fill */
56
- padding: 2px 8px;
57
- border-radius: 6px;
58
  }
59
 
60
- /* ===== Clean "table" (column-consistent widths; compact first two, flexible third) ===== */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  .f1-grid-wrap { text-align: center; margin: 10px auto 8px auto; }
62
  .f1-grid-table {
63
  display: inline-grid;
64
- grid-template-columns: max-content max-content minmax(360px, auto);
65
  border: 1px solid var(--f1-border);
66
  background: var(--f1-bg);
67
  border-radius: 8px;
68
  overflow: hidden;
69
  }
70
  .f1-grid-row { display: contents; }
71
- .f1-grid-cell {
72
- padding: 8px 12px;
73
- text-align: left;
74
- border-left: 1px solid var(--f1-border);
75
- border-top: 1px solid var(--f1-border);
76
- }
77
  .f1-grid-cell:nth-child(3n+1) { border-left: none; }
78
  .f1-grid-head .f1-grid-cell { font-weight: 600; text-align: center; border-top: none; }
79
 
80
- /* ===== Examples block ===== */
81
- #f1-examples {
82
- background: var(--f1-bg-muted); /* #f9fafb */
83
- border: 1px solid var(--f1-border);
84
- border-radius: 10px;
85
- box-shadow: 0 1px 2px rgba(0,0,0,0.04);
86
- margin-bottom: 12px;
87
- }
88
- #f1-examples .form { background: transparent !important; } /* no background on inner .form */
89
-
90
- .f1-tabs-body { padding-top: 12px; text-align: center; }
91
- .f1-examples-chip {
92
- display: inline-block;
93
- background: #e5e7eb; /* slightly darker than #f9fafb */
94
- color: #111827;
95
- padding: 6px 12px;
96
- border-radius: 999px;
97
- font-weight: 700;
98
- }
99
-
100
- /* Problem content: consistent background + padding; modest space before tabs */
101
- #f1-examples .f1-problem-markdown .markdown {
102
- background: var(--f1-bg-muted);
103
- border: 1px solid var(--f1-border);
104
- border-radius: 8px;
105
- padding: 18px;
106
- margin: 10px 14px 10px 14px; /* slightly reduced bottom margin */
107
- }
108
-
109
- /* Pills (Radio) — hide bullets; light gray inactive; darker selected; minimal bottom padding */
110
- #f1-example-radio { border-top: 1px solid var(--f1-border); padding: 8px 10px 4px 10px; margin: 0 8px 4px; }
111
- #f1-example-radio input[type="radio"] { display: none; }
112
- #f1-example-radio .wrap { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
113
- #f1-example-radio label {
114
- border: 1px solid var(--f1-border);
115
- border-radius: 999px;
116
- padding: 6px 10px;
117
- cursor: pointer;
118
- background: #f3f4f6; /* inactive pills */
119
- }
120
- #f1-example-radio input[type="radio"]:checked + span {
121
- background: #e5e7eb; /* active pill */
122
- border-color: var(--f1-border);
123
- border-radius: 999px;
124
- padding: 6px 10px;
125
- }
126
-
127
- /* Gradio video styling (centered, rounded, subtle shadow) */
128
- .f1-video video { width: 100%; max-width: 42rem; display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
129
-
130
  /* Leaderboard: cap width at 800px and center; keep your chain rule */
131
  #formulaone-leaderboard-tab-table { max-width: 800px; margin-left: auto; margin-right: auto; }
132
- #formulaone-leaderboard-tab-table .column .row .column { min-width: 80% !important; } /* exact chain rule */
133
  #formulaone-leaderboard-tab-table .row, #formulaone-leaderboard-tab-table .column { width: 100% !important; max-width: 100% !important; }
134
  #formulaone-leaderboard-tab-table [data-testid="dropdown"], #formulaone-leaderboard-tab-table input[type="text"] { width: 100% !important; }
135
 
136
- /* Login button: force light + width cap at 800 and center */
137
  #hf-login-btn, #hf-login-btn button, button[data-testid="login-button"], [data-testid="login-button"] button, div[data-testid="login-button"] > button {
138
- background: #ffffff !important;
139
- color: #1f2937 !important;
140
- border: 1px solid var(--f1-border) !important;
141
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04) !important;
142
- max-width: 800px !important;
143
- width: 100% !important;
144
- margin-left: auto !important;
145
- margin-right: auto !important;
146
  }
147
  #hf-login-btn:hover, #hf-login-btn button:hover, button[data-testid="login-button"]:hover, [data-testid="login-button"] button:hover, div[data-testid="login-button"] > button:hover { background: #f9fafb !important; }
148
  """
 
6
  --f1-bg: #ffffff;
7
  --f1-bg-muted: #f9fafb;
8
 
9
+ /* Nuke Gradio chrome that interfered with colors */
10
  --block-border-color: transparent !important;
11
  --background-fill-primary: transparent !important;
12
  }
13
 
14
+ /* Width caps */
15
  .f1-container { max-width: 800px; margin: 0 auto; padding: 0 16px; }
16
  .markdown-text { font-size: 16px !important; max-width: 800px; margin: 0 auto; }
17
  #what-is-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
18
+ #f1-examples { max-width: 730px; margin: 0 auto; } /* requested 730px */
19
 
20
+ /* Text */
21
+ .f1-p, .f1-li { line-height: 1.75; color: #374151; text-wrap: pretty; overflow-wrap: break-word; hyphens: auto; }
 
 
 
 
 
 
 
 
 
22
 
23
  /* Headings */
24
  .f1-h1 { font-weight: 700; font-size: 2.25rem; line-height: 2.5rem; color: var(--f1-text); text-align: center; margin-bottom: 1.25rem !important; }
25
+ .f1-h2 { font-weight: 700; border-bottom: 1px solid var(--f1-border); padding-bottom: 0.45rem; margin-top: 1.75rem; margin-bottom: 0.9rem; color: var(--f1-text); font-size: 1.5rem; line-height: 2rem; }
 
 
 
 
 
 
 
 
 
26
 
27
  /* Links */
28
  .f1-a { color: #2563eb; text-decoration: none; font-weight: 500; }
29
  .f1-a:hover { text-decoration: underline; }
30
 
31
+ /* Captions (centered + dark) */
32
+ .f1-figcaption { margin-top: 8px; font-size: 0.875rem; color: #111827; text-align: center; }
33
+ .f1-figcaption-video { margin-top: 6px; } /* a bit tighter under the video */
34
 
35
+ /* Problem name force center from first render; code bg color #f9fafb */
36
+ .f1-problem-markdown p.f1-problem-name,
37
  #f1-examples .f1-problem-markdown .markdown p.f1-problem-name { text-align: center !important; margin: 0 0 8px 0; }
38
+ .f1-problem-markdown p.f1-problem-name code,
39
  #f1-examples .f1-problem-markdown .markdown p.f1-problem-name code {
40
+ display: inline-block; background: #f9fafb !important; padding: 2px 8px; border-radius: 6px;
 
 
 
41
  }
42
 
43
+ /* Problem body: padding + line-height inside Markdown + small space before tabs */
44
+ #f1-examples .f1-problem-markdown .markdown { background: var(--f1-bg-muted); border: 1px solid var(--f1-border); border-radius: 8px; padding: 18px; margin: 10px 14px 10px 14px; line-height: 1.75; }
45
+ #f1-examples .f1-problem-markdown .markdown p { margin: 0.35rem 0; }
46
+
47
+ /* Pills (Radio) — compact spacing at bottom */
48
+ #f1-example-radio { border-top: 1px solid var(--f1-border); padding: 8px 10px 4px 10px; margin: 0 8px 2px; }
49
+ #f1-example-radio input[type="radio"] { display: none; }
50
+ #f1-example-radio .wrap { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
51
+ #f1-example-radio label { border: 1px solid var(--f1-border); border-radius: 999px; padding: 6px 10px; cursor: pointer; background: #f3f4f6; }
52
+ #f1-example-radio input[type="radio"]:checked + span { background: #e5e7eb; border-color: var(--f1-border); border-radius: 999px; padding: 6px 10px; }
53
+
54
+ /* Examples card chrome */
55
+ #f1-examples { background: var(--f1-bg-muted); border: 1px solid var(--f1-border); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 12px; }
56
+ #f1-examples .form { background: transparent !important; } /* no bg on inner form container */
57
+ .f1-tabs-body { padding-top: 12px; text-align: center; }
58
+ .f1-examples-chip { display: inline-block; background: #e5e7eb; color: #111827; padding: 6px 12px; border-radius: 999px; font-weight: 700; }
59
+
60
+ /* Figures via Gradio components (centered, rounded, shadow) */
61
+ .f1-image img, .f1-video video { width: 100%; max-width: 42rem; display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
62
+
63
+ /* Categories "table" — equal width per column set; compact first two, flexible third */
64
  .f1-grid-wrap { text-align: center; margin: 10px auto 8px auto; }
65
  .f1-grid-table {
66
  display: inline-grid;
67
+ grid-template-columns: max-content 12ch minmax(360px, 1fr); /* 2nd col fixed width; 3rd grows */
68
  border: 1px solid var(--f1-border);
69
  background: var(--f1-bg);
70
  border-radius: 8px;
71
  overflow: hidden;
72
  }
73
  .f1-grid-row { display: contents; }
74
+ .f1-grid-cell { padding: 8px 12px; text-align: left; border-left: 1px solid var(--f1-border); border-top: 1px solid var(--f1-border); white-space: normal; }
 
 
 
 
 
75
  .f1-grid-cell:nth-child(3n+1) { border-left: none; }
76
  .f1-grid-head .f1-grid-cell { font-weight: 600; text-align: center; border-top: none; }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /* Leaderboard: cap width at 800px and center; keep your chain rule */
79
  #formulaone-leaderboard-tab-table { max-width: 800px; margin-left: auto; margin-right: auto; }
80
+ #formulaone-leaderboard-tab-table .column .row .column { min-width: 80% !important; }
81
  #formulaone-leaderboard-tab-table .row, #formulaone-leaderboard-tab-table .column { width: 100% !important; max-width: 100% !important; }
82
  #formulaone-leaderboard-tab-table [data-testid="dropdown"], #formulaone-leaderboard-tab-table input[type="text"] { width: 100% !important; }
83
 
84
+ /* Login button: force light and width cap */
85
  #hf-login-btn, #hf-login-btn button, button[data-testid="login-button"], [data-testid="login-button"] button, div[data-testid="login-button"] > button {
86
+ background: #ffffff !important; color: #1f2937 !important; border: 1px solid var(--f1-border) !important; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04) !important;
87
+ max-width: 800px !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important;
 
 
 
 
 
 
88
  }
89
  #hf-login-btn:hover, #hf-login-btn button:hover, button[data-testid="login-button"]:hover, [data-testid="login-button"] button:hover, div[data-testid="login-button"] > button:hover { background: #f9fafb !important; }
90
  """