// Gold / silver / bronze medal for places 1-3 in result tables (also A1-A3 in the finals); // other places stay as they are. The medal still holds the text, so CSV, sorting and the print // table decoration keep working. export function medal(pos) { const value = String(pos ?? "").trim(); const place = /^A?([1-3])$/.exec(value)?.[1]; return place ? `${value}` : value; } // The driver's qualifying place next to a final result; the top qualifier gets a "TQ" badge. export function qualCell(qual, escapeHtml) { const value = String(qual || "").trim(); return `