/* Outcomes: the four states of a ranked query and what stands in the way (frontend/DESIGN.md, "Outcomes").
   Tokens only: both themes work. */

/* The four states of a ranked query as one stacked bar. Never colour alone: fixed is solid, blocked hatched,
   could-not-be-judged an empty dashed box, nothing-to-gain a flat grey; the legend carries the words and numbers. */
.st { display: flex; gap: 2px; height: 14px; min-width: 0; }
.st > span { flex-basis: 0; min-width: 4px; border-radius: 2px; }
.st.is-thin { height: 8px; }
.st-fixed, .st-key.st-fixed { background: var(--win); }
.st-blocked, .st-key.st-blocked { background: var(--warn); background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--warn-bg) 4px 7px); }
.st-not_judged, .st-key.st-not_judged { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink-3); background-image: repeating-linear-gradient(90deg, transparent 0 3px, color-mix(in srgb, var(--ink-3) 30%, transparent) 3px 4px); }
.st-nothing_to_gain, .st-key.st-nothing_to_gain { background: var(--line-strong); }
.st-notrun { flex: 1; border-radius: 2px; border: 1px dashed var(--line-strong); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--surface-3) 5px 8px); }
.st-key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }
.st-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: var(--sp-3) var(--sp-5); align-items: center; }
.st-rows > .st-name { color: var(--ink-2); font-size: var(--fs-2); white-space: nowrap; }
.st-rows > .st-total { color: var(--ink-3); font: 400 var(--fs-2)/1.4 var(--font-mono); white-space: nowrap; text-align: right; }
.st-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-6); margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.st-legend > li { min-width: 0; }
.st-legend a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); margin: 0 calc(-1 * var(--sp-3)); border-radius: var(--r-2); color: var(--ink); }
.st-legend a:hover { background: var(--surface-3); text-decoration: none; }
.st-legend a[aria-current] { background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.st-legend .st-word { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-legend .st-num { grid-column: 2; color: var(--ink-2); font: 400 var(--fs-2)/1.5 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-legend .st-num > b { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .st-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* "Would be removed by": the kind of change, in ink. A kind is not a suggestion, so it is never green. */
.chip.is-by { --c: var(--surface); --cb: var(--ink-2); border-color: var(--ink-2); font-weight: 500; }
.by-none { color: var(--ink-3); border-bottom: 1px dashed var(--line-strong); font-size: var(--fs-2); }

/* How much of a table one run read: a meter with its two absolutes. Full is hatched amber (the whole table). */
.rd { display: inline-flex; align-items: center; gap: var(--sp-3); min-width: 0; white-space: nowrap; font-size: var(--fs-2); color: var(--ink-2); }
.rd > .bar { width: 3.5rem; height: 6px; flex: none; }
.rd > .bar > span { background: var(--ink-3); }
.rd.is-whole > .bar > span { background: var(--warn); }
.rd > b { font: 600 var(--fs-2)/1 var(--font-mono); color: var(--ink); }

/* A blocker on the finding page: a cause box that names a table. Amber rule: something stands in the way. */
.blk { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r-2); background: var(--surface); min-width: 0; }
.blk.is-none { border-left-style: dashed; border-left-color: var(--line-strong); }
.blk-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); min-width: 0; }
.blk-head > b { font-weight: 600; }
.blk-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); min-width: 0; color: var(--ink-2); font-size: var(--fs-2); }
.blk-line > .label { margin: 0; flex: none; width: 7.5rem; }
.blk-line .mono { overflow-wrap: anywhere; }
.blks { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }

/* Lists of ranked queries: a call site without a finding has no id; its mark says so. */
.noid { color: var(--ink-3); font: 400 var(--fs-1)/1 var(--font-mono); }
.tbl.is-list td .l2 > .chip.is-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* A count bar in a list cell. */
.tbl.is-list .l1 > .bar { flex: 0 0 3.5rem; height: 6px; }

/* Small multiples: one state bar per project. */
.proj-rows { display: grid; grid-template-columns: max-content minmax(6rem, 1fr) max-content max-content; gap: var(--sp-3) var(--sp-6); align-items: center; padding: var(--sp-4) var(--sp-5); }
.proj-rows .mono { white-space: nowrap; }
.proj-rows .muted { white-space: nowrap; }
@media (max-width: 1100px) { .proj-rows { grid-template-columns: max-content minmax(4rem, 1fr) max-content; } .proj-rows > .pr-extra { display: none; } }


/* A panel that is only its foot line: the run page's "not reported by this run". */
.panel-foot.is-alone { border-top: 0; }

/* A count bar in a group heading. */
.group-row .group-bar { display: inline-flex; width: 6rem; }
.group-row .group-bar > .bar { width: 100%; }

/* Queries with the "How it ended" column and measured load: the Tables column gives way (the tables are in the
   expanded row and in "Most used tables"). */
.tbl .is-dropped { display: none; }
col.is-dropped { visibility: collapse; width: 0 !important; }
/* A list cell that wraps instead of cutting its words (a reason in the run page's table). */
.tbl .l1.is-wrap { flex-wrap: wrap; white-space: normal; overflow: visible; }
.tbl .l1.is-wrap > a { white-space: normal; overflow-wrap: anywhere; }
