/* benchmark: runs, a run's report, the start dialog and the set editor. */

/* the outcome of a case as a colour */
.bm { --bm-ok: var(--ok-dot); --bm-retried: var(--warn-dot); --bm-failed: var(--bad-dot); --bm-active: var(--accent); --bm-canceled: var(--c-muted); }

.bm-alert { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.bm-alert b { font-weight: 600; margin-right: 4px; }
.bm-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); flex-shrink: 0; }
.mc-k a.big { color: inherit; }
.mc-k a.big.t-warn { color: var(--warn-fg); }
.mc-k a.big.t-bad { color: var(--bad-fg); }
.mc-k .f a { color: inherit; }
.mc-k .f a.t-bad { color: var(--bad-fg); }
.mc-k .f a.t-ok { color: var(--ok-fg); }

/* facet marks */
.mc-sw.bm-f-site { background: var(--warn-dot); }
.mc-sw.bm-f-plat { background: var(--bad-dot); }
.mc-sw.bm-f-req { background: var(--accent); }
.mc-sw.bm-f-oth { background: var(--c-muted); }
.bm-chg { width: 8px; height: 8px; border-radius: 1px; flex-shrink: 0; background: var(--c-muted); }
.bm-chg.broke { background: var(--bad-dot); }
.bm-chg.fixed { background: var(--ok-dot); }
.bm-chg.failing { background: var(--bad-fade); box-shadow: inset 0 0 0 1px var(--bad-dot); }

/* targets and cases lists */
.bm .list { flex: 1 1 0; min-height: 0; }
.bm .tr.bm-tr { height: 54px; border-bottom: 1px solid var(--line-2); }
.bm-thumb { position: relative; width: 72px; height: 44px; border-radius: 3px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.bm-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.bm-thumb::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bm-ok); }
.bm-thumb.retried::after { background: var(--bm-retried); }
.bm-thumb.failed::after { background: var(--bm-failed); }
.bm-thumb.active::after { background: var(--bm-active); }
.bm-thumb.canceled::after { background: var(--bm-canceled); }
.bm-thumb .i { width: 15px; height: 15px; }
.bm-tname { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.bm-tname .sub { font-size: 11px; }
.bm-dots { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.bm-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--bm-ok); }
.bm-dot.retried { background: var(--bm-retried); }
.bm-dot.failed { background: var(--bm-failed); }
.bm-dot.active { background: var(--bm-active); }
.bm-dot.canceled { background: var(--bm-canceled); }
.bm-dot.thin { box-shadow: inset 0 0 0 2px var(--warn-dot); background: var(--warn-bg); }
.bm-chgl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bm-chgl.broke { color: var(--bad-fg); font-weight: 500; }
.bm-chgl.fixed { color: var(--ok-fg); font-weight: 500; }
.bm-chgl.failing { color: var(--bad-fg); }
.bm-tries { display: flex; gap: 3px; flex-wrap: wrap; }
.bm-try { width: 10px; height: 10px; border-radius: 2px; background: var(--c-muted); }
.bm-try.ok { background: var(--ok-dot); }
.bm-try.site { background: var(--warn-dot); }
.bm-try.plat { background: var(--bad-dot); }
.bm-try.req { background: var(--accent); }
.bm-try.info { background: var(--accent); opacity: .5; }
.bm-try.route { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad-dot); }

/* screenshots */
.bm-grid { flex: 1 1 0; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: max-content; gap: 12px; padding: 14px 16px; align-content: start; }
.bm-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 3px solid var(--bm-ok); border-radius: var(--radius); background: var(--card-bg); color: var(--text); overflow: hidden; min-width: 0; transition: box-shadow 80ms; }
.bm-card:hover { color: var(--text); text-decoration: none; box-shadow: 0 0 0 1px var(--accent); }
.bm-card.retried { border-top-color: var(--bm-retried); }
.bm-card.failed { border-top-color: var(--bm-failed); }
.bm-card.active { border-top-color: var(--bm-active); }
.bm-card.canceled { border-top-color: var(--bm-canceled); }
.bm-card.thin { border-top-color: var(--warn-dot); }
.bm-card.cur { box-shadow: 0 0 0 2px var(--accent); }
/* a 16:10 frame that holds in any grid: the height comes from the width */
.bm-shot { position: relative; height: 0; padding-top: 62.5%; background: var(--panel-2); border-bottom: 1px solid var(--line-2); overflow: hidden; display: block; flex-shrink: 0; }
.bm-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.bm-noshot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; padding: 0 12px; }
.bm-noshot .i { width: 20px; height: 20px; }
.bm-badge { position: absolute; left: 6px; top: 6px; max-width: calc(100% - 12px); height: 20px; padding: 0 7px; border-radius: 3px; display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--ok-bg); color: var(--ok-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.bm-badge.retried, .bm-badge.thin { background: var(--warn-bg); color: var(--warn-fg); }
.bm-badge.failed { background: var(--bad-bg); color: var(--bad-fg); }
.bm-badge.active { background: var(--info-bg); color: var(--info-fg); }
.bm-badge.canceled { background: var(--neu-bg); color: var(--neu-fg); }
.bm-badge.chg { left: auto; right: 6px; }
.bm-badge.chg.broke { background: var(--bad-solid); color: #fff; }
.bm-badge.chg.fixed { background: var(--ok-dot); color: #fff; }
.bm-card:has(.bm-noshot) .bm-badge:not(.chg) { display: none; }
.bm-cap { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 9px; min-width: 0; font-size: 13px; }
.bm-cap .mc-name { font-weight: 500; }
.bm-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-reason { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the case drawer */
.bm-dr { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.bm-dr .pnl-nav { margin: 0 -16px; padding: 8px 16px; border-bottom: 1px solid var(--line-2); }
.bm-dr-h { display: flex; flex-direction: column; gap: 8px; }
.bm-dr-h .mono { font-size: 12.5px; }
.bm-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bm-attempts { display: flex; gap: 6px; flex-wrap: wrap; }
.bm-att { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 3px; border: 1px solid var(--line); font-size: 12px; color: var(--text-2); background: var(--panel); }
.bm-att:hover { color: var(--text); text-decoration: none; background: var(--hover); }
.bm-att b { font-weight: 600; color: var(--text); }
.bm-att.ok { border-color: var(--ok-dot); }
.bm-att.site { border-color: var(--warn-dot); }
.bm-att.plat { border-color: var(--bad-dot); }
.bm-att.route { border-style: dashed; }
.bm-att.on { box-shadow: 0 0 0 1px var(--accent); background: var(--cur-bg); color: var(--text); }
.bm-frame { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 560px; background: var(--panel-2); }
.bm-frame img { display: block; width: 100%; height: auto; }
.bm-frame.none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 180px; color: var(--muted); font-size: 13px; }
.bm-frame.none .i { width: 22px; height: 22px; }
.bm-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.bm-sec.bm-row { flex-direction: row; }

/* telemetry */
.bm-tele { flex: 1 1 0; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 14px; padding: 14px 16px; align-content: start; }
.bm-card-s { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow-x: auto; }
.bm-card-s.wide { grid-column: 1 / -1; }
.bm-t { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.bm-t th { text-align: right; font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 8px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.bm-t td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bm-t th:first-child, .bm-t td:first-child { text-align: left; padding-left: 0; }
.bm-t td.ell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.bm-t tr:last-child td { border-bottom: 0; }
.bm-lastrun { display: block; color: inherit; }
.bm-lastrun:hover { text-decoration: none; color: inherit; }

/* the start dialog */
.bm-start-set { margin-bottom: 14px; }
.bm-start-set .bm-row .inp { flex: 1 1 0; }
.bm-start { display: flex; flex-direction: column; gap: 14px; }
.bm-pick { display: none; flex-direction: column; max-height: 220px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.bm-start:has(input[name="scope"][value="pick"]:checked) .bm-pick { display: flex; }
.bm-pick-r { display: grid; grid-template-columns: 14px minmax(0, 0.8fr) minmax(0, 1fr); gap: 8px; align-items: center; min-height: 28px; padding: 0 10px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; cursor: pointer; }
.bm-pick-r:last-child { border-bottom: 0; }
.bm-pick-r:hover { background: var(--hover); }
.bm-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bm-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.bm-check .sub { font-size: 12px; }
.bm-check.dng { color: var(--bad-fg); }
.bm-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* the set editor */
.bm-set { flex: 1 1 0; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; align-items: start; background: var(--panel); }
.bm-set-main, .bm-set-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bm-set-sec { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.bm-set-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bm-set-h label.btn { cursor: pointer; }
.bm-targets { min-height: 280px; font-size: 12.5px; line-height: 1.55; resize: vertical; white-space: pre; }
.bm-tlist { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); max-height: 420px; overflow-y: auto; }
.bm-trow { display: grid; grid-template-columns: 16px minmax(0, 0.9fr) minmax(0, 1fr) auto 28px; gap: 8px; align-items: center; min-height: 30px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.bm-trow .sub { font-size: 11.5px; }
.bm-prof { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.bm-prof summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 500; }
.bm-prof summary .sub { font-weight: 400; font-size: 12px; }
.bm-prof-b { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; }
.bm-set-f { text-align: right; font-size: 12.5px; }
.bm-rej { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }

@container content (width < 900px) {
	.bm-set { grid-template-columns: minmax(0, 1fr); }
	.bm-tele { grid-template-columns: minmax(0, 1fr); }
	.bm-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
