/* Gradio "Default" theme look (the original Quranic ASR leaderboard), as a static page. */
:root {
  --accent: #f97316;
  --accent-soft: #fff7ed;
  --bg: #ffffff;
  --bg-2: #fafafa;
  --text: #27272a;
  --text-2: #71717a;
  --border: #e4e4e7;
  --table-border: #d4d4d8;
  --row-odd: #fafafa;
  --row-even: #ffffff;
  --gold-row: rgba(201, 162, 39, .07);
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --code-bg: #f4f4f5;
  --tip-bg: #27272a;
  --tip-text: #fafafa;
  --input-bg: #ffffff;
  --logo-invert: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-soft: #3f3f46;
    --bg: #0f0f11;
    --bg-2: #18181b;
    --text: #f4f4f5;
    --text-2: #bbbbc2;
    --border: #3f3f46;
    --table-border: #3f3f46;
    --row-odd: #18181b;
    --row-even: #0f0f11;
    --gold-row: rgba(201, 162, 39, .12);
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --code-bg: #27272a;
    --tip-bg: #f4f4f5;
    --tip-text: #18181b;
    --input-bg: #27272a;
    --logo-invert: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-soft: #3f3f46;
  --bg: #0f0f11;
  --bg-2: #18181b;
  --text: #f4f4f5;
  --text-2: #bbbbc2;
  --border: #3f3f46;
  --table-border: #3f3f46;
  --row-odd: #18181b;
  --row-even: #0f0f11;
  --gold-row: rgba(201, 162, 39, .12);
  --link: #60a5fa;
  --link-hover: #93c5fd;
  --code-bg: #27272a;
  --tip-bg: #f4f4f5;
  --tip-text: #18181b;
  --input-bg: #27272a;
  --logo-invert: invert(1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Source Sans Pro", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
.container { max-width: min(1720px, 97vw); margin: 0 auto; padding: 28px 16px 40px; }

.theme-row { display: flex; justify-content: flex-end; }
.theme-btn {
  font: inherit; font-size: 14px; color: var(--text-2); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.theme-btn:hover { color: var(--text); }

/* prose (gr.Markdown) */
.prose h1 { font-size: 2em; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 10px; line-height: 1.2; }
.prose h2 { font-size: 1.5em; font-weight: 600; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 1.17em; font-weight: 600; margin: 1.2em 0 .4em; }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 .9em; }
.prose li { margin: .25em 0; }
.prose blockquote {
  margin: 0 0 .9em; padding: .2em 0 .2em 1em; border-left: 4px solid var(--border); color: var(--text);
}
.prose blockquote p { margin: .4em 0; }
.prose code { background: var(--code-bg); border-radius: 4px; padding: 1px 5px; font-size: .92em; }
.prose .links { font-size: 15px; }
.prose .formula {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px;
  font-weight: 600; display: inline-block;
}

/* tabs (gr.Tabs) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 16px; overflow-x: auto; }
.tabs button {
  font: inherit; font-size: 15px; color: var(--text-2); background: none; border: 1px solid transparent;
  border-bottom: none; border-radius: 6px 6px 0 0; padding: 8px 14px; cursor: pointer; white-space: nowrap;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  color: var(--text); background: var(--bg); border-color: var(--border); border-bottom: 2px solid var(--accent);
  font-weight: 600;
}
.panel { min-height: 200px; }
.intro { margin: 0 0 14px; max-width: 70em; }

/* controls (gr.Row of blocks) */
.controls { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.block {
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg); padding: 10px 12px 12px;
  margin: 0; min-width: 0;
}
.grow3 { flex: 3 1 260px; }
.grow2 { flex: 2 1 220px; }
.block-label { display: block; font-size: 14px; color: var(--text-2); margin: 0 0 8px; padding: 0; float: none; }
fieldset.block legend { float: left; width: 100%; }
fieldset.block .opts { clear: both; }
input[type="text"] {
  width: 100%; font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 10px;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 12px; cursor: pointer; background: var(--bg); font-size: 15px; user-select: none;
}
.opt:hover { background: var(--bg-2); }
.opt input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; }

/* table (gr.Dataframe) */
.table-wrap {
  border: 1px solid var(--table-border); border-radius: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
#board table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
#board th, #board td {
  padding: 12px; border-bottom: 1px solid var(--table-border); border-right: 1px solid var(--table-border);
  text-align: left; white-space: nowrap; line-height: 1.45;
}
#board th:last-child, #board td:last-child { border-right: none; }
#board tbody tr:last-child td { border-bottom: none; }
#board thead th {
  position: sticky; top: 0; z-index: 2; background: var(--row-even); font-weight: 600; cursor: pointer;
}
#board thead th.num, #board td.num { text-align: right; }
#board thead th .h { border-bottom: 1px dotted var(--text-2); }
#board thead th .dir { color: var(--accent); font-weight: 700; }
.legend { font-size: 14px; color: var(--text-2); margin: 0 0 8px; }
#board thead th.sorted::after { content: " ▾"; color: var(--accent); }
#board tbody tr:nth-child(odd) td { background: var(--row-odd); }
#board tbody tr:nth-child(even) td { background: var(--row-even); }
#board tbody tr.gold td { background: var(--gold-row); }
#board td.rank { min-width: 76px; }
#board td.model { min-width: 300px; }
#board td.model { position: relative; padding-left: 62px; vertical-align: top; padding-top: 12px; min-height: 36px; }
#board td.model img {
  position: absolute; left: 14px; top: 11px; width: 36px; height: 36px; object-fit: contain; box-sizing: border-box;
  padding: 5px; background: #fff; border: 1px solid rgba(120, 130, 150, .28); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(20, 30, 50, .14);
}
#board td.model img.fill { padding: 0; object-fit: cover; }
#board td.num .inc { color: var(--text-2); font-weight: 400; }
#board td .acc { display: block; white-space: nowrap; }
#board td .acc b { font-size: 15px; }
#board td .acc2 { display: block; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
#board td.model a.pred { font-size: 12px; margin-left: 6px; }
#board td.model .msum { display: block; white-space: normal; font-size: 13px; line-height: 1.4; color: var(--text-2);
  max-width: 440px; margin-top: 4px; }
#board td.model .msum .hears { display: block; margin-top: 2px; font-style: italic; }
#board td.main { font-weight: 600; }
#board td.tj { white-space: normal; min-width: 150px; }
#board td.tj .caps { margin-top: 5px; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; line-height: 1.35; }
#board td.tj .cap.y { color: #16a34a; }
#board td.tj .cap.n { color: var(--text-2); opacity: .75; }
#board td.tj .yes { color: #16a34a; font-weight: 700; }
#board td.tj .no { color: var(--text-2); }
#board tbody tr.ref td { color: var(--text-2); font-style: italic; background: var(--bg-2); }
#board tbody tr.ref:first-of-type td, #board tbody tr:not(.ref) + tr.ref td { border-top: 2px dashed var(--table-border); }
#board td.na { color: var(--text-2); }
#board td [data-tip] { border-bottom: 1px dotted var(--text-2); cursor: help; }
#board td .sub { color: var(--text-2); }
.empty { padding: 18px; color: var(--text-2); }
.caption { font-style: italic; color: var(--text-2); margin: 10px 0 0; font-size: 15px; max-width: 80em; }

/* tooltip */
.tip {
  position: fixed; z-index: 50; max-width: min(360px, calc(100vw - 32px)); background: var(--tip-bg);
  color: var(--tip-text); font-size: 13.5px; line-height: 1.45; padding: 8px 10px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); pointer-events: none; white-space: normal;
}

/* accordion (gr.Accordion) */
.accordion { border: 1px solid var(--border); border-radius: 4px; margin-top: 28px; background: var(--bg); }
.accordion summary { cursor: pointer; padding: 10px 14px; font-size: 15px; }
.accordion pre {
  margin: 0 14px 14px; padding: 12px; background: var(--code-bg); border-radius: 6px; overflow-x: auto;
  font-size: 13px; line-height: 1.5;
}

@media (max-width: 640px) {
  .container { padding: 18px 16px 32px; max-width: 100%; }
  .prose h1 { font-size: 1.6em; }
  #board td.model { min-width: 0; white-space: normal; }
  #board th, #board td { padding: 9px 10px; }
  #board td.tj .no { font-size: 13px; }
}

#board td.rank .tie { color: var(--text-2); font-size: 13px; cursor: help; }
