Urdatorn's picture
Nudge confusion matrix column labels right
04cc2c8
Raw History Blame
13.8 kB
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');
:root {
font-family: 'Manrope', sans-serif;
color: #24231f;
background: #f7f5ef;
font-synthesis: none;
--page: #f7f5ef;
--surface: #fffef9;
--surface-muted: #efede6;
--row-alt: #f8f6f0;
--text: #24231f;
--text-muted: #67645b;
--text-subtle: #928e82;
--border: #dedbd1;
--border-strong: #c6c1b4;
--primary: #255c47;
--primary-strong: #174532;
--primary-soft: #dfece5;
--accent: #d86b3c;
--shadow-sm: 0 1px 2px rgb(42 39 31 / 5%);
}
:root[data-theme='dark'] {
color-scheme: dark;
--page: #161814;
--surface: #1d201b;
--surface-muted: #272b24;
--row-alt: #22251f;
--text: #f2f0e9;
--text-muted: #b4b1a7;
--text-subtle: #89877f;
--border: #383c34;
--border-strong: #4b5046;
--primary: #7fc4a2;
--primary-strong: #a6d9bf;
--primary-soft: #253d31;
--accent: #ef936d;
--shadow-sm: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--page); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); color: var(--text); }
button, input { font: inherit; }
a { color: inherit; }
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 68px;
padding: 0 max(24px, calc((100vw - 1400px) / 2));
border-bottom: 1px solid var(--border);
background: color-mix(in srgb, var(--page) 92%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--page); font: 500 16px 'DM Mono', monospace; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--text-muted); font-size: 13px; font-weight: 600; text-decoration: none; }
nav a:hover { color: var(--text); }
.theme-toggle { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
main { width: min(100% - 48px, 1400px); margin: 0 auto; }
.eyebrow { margin: 0 0 14px; color: var(--primary); font: 500 11px 'DM Mono', monospace; letter-spacing: 0.15em; text-transform: uppercase; }
.leaderboard-section { padding: 46px 0 64px; }
.leaderboard-section + .leaderboard-section { padding-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 40px); font-weight: 500; letter-spacing: -0.045em; }
.result-count { color: var(--text-subtle); font: 500 11px 'DM Mono', monospace; text-transform: uppercase; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.interaction-hint { margin: 0; color: var(--text-subtle); font-size: 11px; }
.search-field { display: flex; align-items: center; gap: 8px; width: 280px; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-subtle); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.segments { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-muted); }
.segments button { padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.segments button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); overscroll-behavior-x: contain; }
table { min-width: 850px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th, td { border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
thead th { position: sticky; top: 0; z-index: 2; padding: 0; background: var(--surface-muted); color: var(--text-muted); font-weight: 600; }
.group-row th { border-bottom: 1px solid var(--border-strong); }
.task-group { padding: 8px 12px; text-align: center; color: var(--text-subtle); font: 500 10px 'DM Mono', monospace; letter-spacing: 0.09em; text-transform: uppercase; }
tbody th, tbody td { padding: 12px; }
tbody tr:nth-child(even) :is(th, td) { background-color: var(--row-alt); }
tbody tr:hover :is(th, td) { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--primary) 6%, transparent); }
tbody tr.selectable-row { cursor: pointer; }
tbody tr.selectable-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
tbody tr.selected :is(th, td) { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--primary) 12%, transparent); }
tbody tr:last-child :is(th, td) { border-bottom: 0; }
.sticky { position: sticky; z-index: 1; background: var(--surface); }
thead .sticky { z-index: 4; background: var(--surface-muted); }
.model-column { left: 0; min-width: 170px; }
.dimension-column { min-width: 130px; font-family: 'DM Mono', monospace; }
.classifier-column { min-width: 155px; max-width: 190px; border-right: 1px solid var(--border-strong); overflow: hidden; text-overflow: ellipsis; }
tbody tr.selected td.classifier-column { overflow: visible; white-space: normal; text-overflow: clip; line-height: 1.5; }
.owner { color: var(--text-subtle); font-weight: 400; }
.model-link { color: var(--text); text-decoration: none; }
.model-link:hover strong { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.external { margin-left: 5px; color: var(--text-subtle); font-size: 9px; }
.score-header { min-width: 100px; }
.score-cell { text-align: right; font: 500 12px 'DM Mono', monospace; background-image: linear-gradient(90deg, color-mix(in srgb, var(--primary) 12%, transparent) var(--score), transparent var(--score)); }
.score-cell.missing { color: var(--text-subtle); background-image: none; }
.status-column { min-width: 190px; border-left: 1px solid var(--border-strong); }
.status-cell { border-left: 1px solid var(--border-strong); }
.status-badge { padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 4px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text-muted); font-size: 10px; }
.empty { padding: 28px; color: var(--text-muted); text-align: center; }
.sort-button { all: unset; display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; width: 100%; min-height: 38px; padding: 7px 10px; box-sizing: border-box; cursor: pointer; transition: background 0.12s, color 0.12s; }
.sort-button.left { justify-content: flex-start; }
.sort-button:hover { background: var(--primary-soft); color: var(--text); }
.sort-button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.sort-icon { color: var(--text-subtle); font: 500 10px 'DM Mono', monospace; opacity: 0.45; }
.sort-icon.active { color: var(--primary); opacity: 1; }
.tip-wrap { position: relative; display: inline-flex; }
.info-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-muted); font: 700 9px/1 'Manrope', sans-serif; cursor: help; }
.tooltip { position: fixed; z-index: 50; top: var(--tip-y); left: var(--tip-x); display: grid; gap: 5px; width: 250px; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--text); color: var(--page); box-shadow: 0 12px 30px rgb(0 0 0 / 18%); font-size: 11px; font-weight: 400; line-height: 1.45; white-space: normal; transform: translateX(-50%); }
.tooltip strong { font-size: 11px; }
.table-caption { display: flex; align-items: center; gap: 6px; margin: 11px 2px 0; color: var(--text-subtle); font-size: 11px; }
.accuracy-chart { margin-top: 28px; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.chart-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 10px; }
.chart-heading h3 { margin: 0 0 5px; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.chart-heading p:not(.eyebrow) { margin: 0; color: var(--text-muted); font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; color: var(--text-muted); font-size: 11px; }
.chart-legend .legend-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 6px; border: 1px solid transparent; border-radius: 999px; background: none; color: inherit; font: inherit; line-height: 1.4; cursor: pointer; transition: opacity 0.12s, border-color 0.12s, background 0.12s; }
.chart-legend .legend-toggle:hover { border-color: var(--border); background: var(--surface-muted); }
.chart-legend .legend-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.chart-legend .legend-toggle.hidden { opacity: 0.5; text-decoration: line-through; }
.chart-legend .legend-toggle.hidden i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--legend-color); }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--legend-color); }
.bar-selection { display: flex; align-items: baseline; gap: 9px; min-height: 19px; margin: 0 0 8px; color: var(--text-muted); font-size: 11px; }
.bar-selection strong { color: var(--text); }
.bar-selection b { color: var(--primary-strong); font: 600 12px 'DM Mono', monospace; }
.chart-scroll { overflow-x: auto; }
.chart-scroll svg { display: block; min-width: 920px; width: 100%; height: auto; }
.grid-line { stroke: var(--border); stroke-width: 1; }
.axis-tick, .axis-title, .author-label { fill: var(--text-muted); font-family: 'DM Mono', monospace; font-size: 10px; }
.axis-title { font-size: 11px; font-weight: 500; }
.empty-chart { fill: var(--text-muted); font-family: 'Manrope', sans-serif; font-size: 12px; }
.accuracy-bar { cursor: pointer; opacity: 0.66; outline: none; stroke: var(--surface); stroke-width: 0.7; transition: opacity 0.12s, stroke-width 0.12s; }
.accuracy-bar:hover, .accuracy-bar:focus-visible, .accuracy-bar.selected { opacity: 1; stroke: var(--text); stroke-width: 2.5; }
.confusion-section { margin-top: 18px; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.matrix-list { display: grid; grid-template-columns: repeat(3, minmax(520px, 1fr)); gap: 18px; overflow-x: auto; padding-bottom: 7px; }
.matrix-card { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-muted); }
.matrix-card figcaption { margin-bottom: 12px; color: var(--text); font: 600 12px 'DM Mono', monospace; }
.matrix-scroll { overflow: visible; padding-top: 68px; }
.confusion-grid { display: grid; grid-template-columns: 92px repeat(var(--matrix-size), 22px); grid-auto-rows: 22px; width: max-content; font: 500 7px 'DM Mono', monospace; }
.corner { display: flex; align-items: end; padding: 0 4px 3px 0; color: var(--text-subtle); font-size: 7px; line-height: 1.2; }
.column-label { position: relative; left: 11px; align-self: end; width: 82px; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; transform: rotate(-58deg); transform-origin: left bottom; }
.row-label { display: flex; align-items: center; padding-right: 6px; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.column-label.selected-axis, .row-label.selected-axis { color: var(--text); font-weight: 700; }
.matrix-cell { position: relative; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--surface) 72%, transparent); background: color-mix(in srgb, var(--accent) var(--intensity), var(--surface)); color: color-mix(in srgb, var(--text) 82%, transparent); cursor: default; }
.matrix-cell.diagonal { background: color-mix(in srgb, var(--primary) var(--intensity), var(--surface)); }
.matrix-cell.selected-row, .matrix-cell.selected-column { z-index: 1; border-color: var(--text); border-width: 1.5px; }
.cell-tip { position: absolute; z-index: 20; bottom: calc(100% + 5px); left: 50%; display: none; width: max-content; max-width: 230px; padding: 7px 8px; border-radius: 4px; background: var(--text); color: var(--page); font: 400 9px 'Manrope', sans-serif; transform: translateX(-50%); }
.cell-tip strong { display: block; margin-top: 2px; }
.matrix-cell:hover { outline: 2px solid var(--text); z-index: 10; }
.matrix-cell:hover .cell-tip { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
.controls { align-items: stretch; flex-direction: column; }
.search-field { width: 100%; }
.segments { overflow-x: auto; }
.segments button { flex: 0 0 auto; }
.chart-heading { align-items: start; flex-direction: column; }
.chart-legend { justify-content: flex-start; }
.confusion-section { padding: 14px; }
}
@media (max-width: 640px) {
main { width: min(100% - 28px, 1400px); }
.topbar { padding-inline: 14px; }
nav { gap: 12px; }
nav a { display: none; }
.leaderboard-section { padding-block: 36px 52px; }
.sticky, thead .sticky { position: static; }
.model-column { min-width: 145px; }
.classifier-column { min-width: 230px; }
}