/* timing.css — Race › Timing table (js/timing-view.js). v2 tokens; dense live-timing rows. */
.timing-panel { display: grid; gap: var(--s2, 8px); padding: var(--s3, 12px); min-width: 0; }

/* Class band on top, in the theme's accent. */
.tm-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 4px 10px; border-radius: var(--v2-r-sm, 3px);
    background: var(--accent); color: var(--ink); font-size: var(--v2-fs-sm, 13px); font-weight: 800; }
.tm-bar:has(.tm-cls:empty):has(.tm-meta:empty) { display: none; }
.tm-meta { font-weight: 600; opacity: .8; }

/* Scrolls sideways inside itself on narrow screens; the page never does. */
.tm-wrap { overflow-x: auto; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: var(--v2-r-md, 6px); background: var(--panel); -webkit-overflow-scrolling: touch; }
.tm-wrap:has(.tm-adv) { width: auto; }   /* Advanced spans the page, like a timing screen */
.tm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--v2-font-mono, ui-monospace, monospace); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-table th, .tm-table td { padding: 2px 8px; height: 30px; box-sizing: border-box; text-align: right; border-bottom: 1px solid var(--line); background: var(--panel); }
.tm-table thead th { position: sticky; top: 0; z-index: 2; height: auto; padding-top: 5px; padding-bottom: 5px; font-family: var(--v2-font-ui, inherit);
    font-size: var(--v2-fs-xs, 11px); letter-spacing: var(--v2-track-caps, .08em); text-transform: uppercase; color: var(--text-2); font-weight: 700; background: var(--v2-raise, var(--panel)); }
.tm-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 100%, var(--text) 3%); }
.tm-table .tm-driver, .tm-table .tm-rating, .tm-table .tm-car { text-align: left; }
.tm-table .tm-stints, .tm-table .tm-loc, .tm-table .tm-tire { text-align: center; }

/* Place and driver stay put while the rest scrolls. */
.tm-table .tm-pos { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; font-weight: 700; }
.tm-table .tm-driver { position: sticky; left: 40px; z-index: 1; min-width: 170px; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--v2-font-ui, inherit); line-height: 1.1; box-shadow: inset -1px 0 0 var(--line); }
.tm-table thead .tm-pos, .tm-table thead .tm-driver { z-index: 3; }
.tm-driver b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.tm-driver small, .tm-stint small { color: var(--text-3); font-size: 10px; }
.tm-driver small { display: block; overflow: hidden; text-overflow: ellipsis; }

.tm-make { display: inline-block; min-width: 3.2em; text-align: center; font-size: 10px; font-weight: 700; color: var(--text-2);
    border: 1px solid var(--line-2, var(--line)); border-radius: var(--v2-r-sm, 3px); padding: 0 3px; }
.tm-rating i { font-style: normal; font-size: 10px; color: var(--text-3); margin: 0 3px 0 6px; }
.tm-rating i:first-child { margin-left: 0; }
.tm-tag { display: inline-block; min-width: 2em; text-align: center; font-weight: 800; font-size: 11px; border-radius: 2px; padding: 0 2px; margin-right: 3px;
    color: var(--ink); background: var(--text-3); }
.tm-tag-P { background: var(--info); }
.tm-tag-G { background: var(--warn); }
.tm-tag-S { background: var(--text-2); }
.tm-tag-B { background: var(--warn-deep, var(--warn)); }

.tm-table tr.tm-empty th { text-align: left; color: var(--text-3); font-weight: 400; padding: 12px 8px; }
.tm-table tr.tm-me td { background: color-mix(in srgb, var(--panel) 80%, var(--accent) 20%); }
.tm-table tr.tm-me .tm-pos { box-shadow: inset 3px 0 0 var(--accent); }
.tm-table tr.tm-me .tm-driver b { color: var(--accent); }
.tm-table .c-best { color: var(--dx-best); font-weight: 700; }
.tm-table .c-good { color: var(--dx-good); }
.tm-table .c-gain { color: var(--dx-good); }
.tm-table .c-loss { color: var(--crit); }
.tm-pitb { display: inline-block; color: var(--ink); background: var(--info); border-radius: var(--v2-r-sm, 3px); font-weight: 800; font-size: 10px; padding: 1px 8px; letter-spacing: .04em; }
.tm-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 800;
    color: var(--ink); background: var(--text-2); margin: 0 1px; }
.tm-chip { display: inline-block; border-radius: var(--v2-r-sm, 3px); font-size: 10px; font-weight: 800; padding: 1px 5px; margin-left: 3px; color: var(--ink); }
.tm-chip.tm-pen { background: var(--crit); }

/* Four compound dots, FL FR over RL RR. Soft red, medium yellow, hard white, inter green, wet blue. */
.tm-tires { display: inline-grid; grid-template-columns: 7px 7px; gap: 2px; vertical-align: middle; }
.tm-tc { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--text-3); }
.tm-tc.tm-cS { background: var(--crit); box-shadow: none; }
.tm-tc.tm-cM { background: var(--warn); box-shadow: none; }
.tm-tc.tm-cH { background: var(--text-hi, var(--text)); box-shadow: none; }
.tm-tc.tm-cI { background: var(--dx-good); box-shadow: none; }
.tm-tc.tm-cW { background: var(--info); box-shadow: none; }

/* Simple shows the core columns; Advanced adds the rest. Rating waits for data. */
.tm-table:not(.tm-adv) .tm-x, .tm-table.tm-norating .tm-rating { display: none; }

@media (max-width: 600px) {
    .tm-table th, .tm-table td { padding: 2px 5px; }
    .tm-table .tm-pos { width: 30px; min-width: 30px; }
    .tm-table .tm-driver { left: 30px; min-width: 0; max-width: 120px; }
}
