/* Custom-benchmark builder: the coverage table (```grid) and the test rows (```rows) drawn inside answers.
   The chat page's look is in kit/chat.css; these blocks use its tokens and the tool's green (--tool) in small places. */

:root {
  --b5-ref: #2f6fc4;   /* reference answer */
  --b5-rule: #8a5a14;  /* rule */
  --b5-end: #7a4cc2;   /* end state */
  --b5-hard: #c2453d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --b5-ref: #78aaf0; --b5-rule: #e5b25a; --b5-end: #b896f0; --b5-hard: #ef7d73; }
}
:root[data-theme="dark"] { --b5-ref: #78aaf0; --b5-rule: #e5b25a; --b5-end: #b896f0; --b5-hard: #ef7d73; }

.k-block-grid, .k-block-rows { margin: 14px 0 18px; }
.b5-wait { border: 2px dashed var(--border); border-radius: 14px; padding: 22px 18px; }

.b5-card { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.b5-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.b5-kicker { font: 700 11px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tool); }
.b5-title { font: 600 19px/1.25 var(--font-display); color: var(--ink); }
.b5-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.b5-live { margin-left: auto; font-size: 13px; }
.b5-sec { margin: 14px 0 6px; font: 700 11px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.b5-sec em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.b5-note { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.b5-muted { color: var(--muted); }
.b5-off { color: var(--bad); }

/* tables */
.b5-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.b5-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.b5-table th, .b5-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.b5-table thead th { font-weight: 600; font-size: 12.5px; color: var(--muted); background: var(--surface-2); }
.b5-table tbody tr:last-child td, .b5-table tbody tr:last-child th { border-bottom: 0; }
.b5-table tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 600; }
.b5-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.b5-name { font-weight: 600; }

/* small labels */
.b5-tag { display: inline-block; font-size: 12px; line-height: 1.35; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); margin: 0 4px 4px 0; white-space: nowrap; }
.b5-tag.f-ref { color: var(--b5-ref); border-color: currentColor; }
.b5-tag.f-rule { color: var(--b5-rule); border-color: currentColor; }
.b5-tag.f-end { color: var(--b5-end); border-color: currentColor; }
.b5-tag.d-hard { color: var(--b5-hard); border-color: currentColor; }
.b5-tag.d-easy { color: var(--good); border-color: currentColor; }
.b5-tag.src { border-style: dashed; }
.b5-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.b5-legend .b5-tag { margin: 0; }
.b5-legend span:last-child { margin-left: 4px; }

/* users */
.b5-users { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.b5-users li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 14px; line-height: 1.35; }
.b5-users li span { display: block; font-size: 12.5px; color: var(--muted); }

/* ways of writing: bars */
.b5-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.b5-bars li { display: grid; grid-template-columns: 165px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: 13.5px; }
.b5-bar { height: 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.b5-bar i { display: block; height: 100%; background: var(--b5-hard); opacity: 0.75; }
.b5-bars li.d-easy .b5-bar i { background: var(--good); }
.b5-bn { text-align: right; font-variant-numeric: tabular-nums; }
.b5-hard { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }

/* rows */
.b5-rowtable td { font-size: 14px; }
.b5-rowtable td.b5-id { white-space: nowrap; font: 600 12.5px/1.4 var(--mono); color: var(--muted); width: 1%; }
.b5-half { display: block; width: max-content; margin-top: 4px; font: 600 10.5px/1.4 var(--font); letter-spacing: 0.03em; text-transform: uppercase; color: var(--tool); border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; }
.b5-half.held { color: var(--muted); border-style: dashed; }
.b5-sum .b5-half { display: inline-block; margin: 0 2px 0 6px; }
.b5-quote { font-size: 14.5px; margin-bottom: 6px; }
.b5-quote::before { content: "\201C"; color: var(--faint); }
.b5-quote::after { content: "\201D"; color: var(--faint); }
.b5-cell { line-height: 1; }
.b5-exp { min-width: 220px; width: 42%; }
.b5-exp > div { margin-top: 2px; }
.b5-setup { margin-top: 6px !important; font-size: 13px; color: var(--muted); }
.b5-rowtable tr.is-held td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }

.b5-earlier { margin-bottom: 6px; padding-left: 8px; border-left: 2px solid var(--border-strong); font-size: 13px; line-height: 1.4; color: var(--muted); }
.b5-earlier b { font-weight: 600; }
.b5-rowtable tr.is-del td, .b5-rowtable tr.is-gone td { color: var(--muted); }
.b5-rowtable tr.is-gone .b5-quote { text-decoration: line-through; }
.b5-hardreq { color: var(--b5-hard); }

/* the combinations the page picked, folded inside the student's message */
.b5-picked { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--muted); white-space: normal; }
.b5-picked summary { cursor: pointer; }
.b5-picked ul { margin: 6px 0 0; padding-left: 18px; }

/* footer: the whole benchmark */
.b5-foot:empty { display: none; }
.b5-foot { margin-top: 10px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.b5-sum { font-size: 14px; line-height: 1.5; }
.b5-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; line-height: 1.45; }
.b5-checks li { position: relative; padding-left: 22px; }
.b5-checks li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.b5-checks li.ok::before { content: "\2713"; color: var(--good); }
.b5-checks li.bad::before { content: "!"; color: var(--bad); left: 4px; }
.b5-checks li.warn::before { content: "!"; color: var(--warn); left: 4px; }
.b5-cov th { font-weight: 600; }
.b5-cov tbody th { font-size: 13.5px; }
.b5-cov td.empty { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); font-weight: 600; }
.b5-cov td.h1 { background: color-mix(in srgb, var(--tool) 10%, var(--surface)); }
.b5-cov td.h2 { background: color-mix(in srgb, var(--tool) 20%, var(--surface)); }
.b5-cov td.h3 { background: color-mix(in srgb, var(--tool) 30%, var(--surface)); }
.b5-cov td.h4 { background: color-mix(in srgb, var(--tool) 40%, var(--surface)); }
.b5-cov td.tot { font-weight: 600; }
.b5-diffs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; font-size: 13px; }
.b5-diffs span { border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; }
.b5-diffs .d-hard { color: var(--b5-hard); }
.b5-diffs .d-easy { color: var(--good); }
.b5-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* phone: each row becomes a card */
@media (max-width: 700px) {
  .b5-card { padding: 10px; margin: 0 -4px; }
  .b5-count, .b5-live { margin-left: 0; width: 100%; }
  .b5-bars li { grid-template-columns: 150px minmax(0, 1fr) 26px; }
  .b5-rowtable thead { display: none; }
  .b5-rowtable, .b5-rowtable tbody, .b5-rowtable tr, .b5-rowtable td { display: block; width: auto; }
  .b5-rowtable tr { border-bottom: 1px solid var(--border); padding: 8px 10px; }
  .b5-rowtable tbody tr:last-child { border-bottom: 0; }
  .b5-rowtable td { border: 0; padding: 2px 0; }
  .b5-rowtable td.b5-id { display: flex; gap: 8px; align-items: center; }
  .b5-rowtable td.b5-id .b5-half { margin-top: 0; }
  .b5-exp { min-width: 0; padding-top: 6px !important; }
  .b5-req th:nth-child(2), .b5-req td:nth-child(2) { display: none; }
  .b5-req td, .b5-req th { word-break: normal; overflow-wrap: normal; }
}

/* the chat's answer lists are indented; these drawn lists are not */
.c-answer .b5-users, .c-answer .b5-bars, .c-answer .b5-checks { padding-left: 0; margin-left: 0; }
.c-answer .b5-users li, .c-answer .b5-bars li, .c-answer .b5-checks li { margin: 0; }

/* the grid of the rows written: names stay readable on a phone, the table scrolls sideways inside its frame */
.b5-cov th, .b5-cov td { word-break: normal; overflow-wrap: normal; }
.b5-cov thead th { white-space: nowrap; }
.b5-cov tbody th { min-width: 130px; }
