/* Optical centring of table cells (td / th), tab strips that are not <button>s, chips, badges and menu rows
 * (owner: "tab text is still not centred, it's still top-aligned in most cells"). Sibling of control-centring.css, loaded after it.
 * Same measured method (tests/browser/button_centring.cjs, docs/reports/text-centring-tabs-cells.md): the label is rendered as HHH and
 * diffed against transparent text, and its ink centre must sit within +-0.5 px of the box centre.
 *
 * Why cells sat high: every legacy table gave its cells a fractional line-height (1.3 -> 14.3 px, 1.2 -> 11.4 px, 16 px, 18.6 px), whose
 * leading Blink splits with floor(); half of the tables aligned to the baseline or the top; and glyph spans (font-size 1.25em,
 * line-height 1) stretched the line box upwards. Fix, in one place: vertical-align: middle, a leading-free line box (the font's own
 * rounded ascent + descent, so no leading and a fallback glyph font cannot stretch it), glyph children as zero-height boxes, and the cap-centre correction of the
 * rounded line box (up to 0.4 px at 10 / 14 px) as a zero-height ::before block with margin-top -2e: it shifts the text up by e and
 * leaves every table's authored padding alone. Glyph runs are centred by their measured ink in glyph-centring.js.
 * Needs only round() (Chrome 125, Safari 15.4, Firefox 118); older engines keep the plain declarations (vertical-align: middle).
 */
html:not(#o):not(#o):not(#o):not(#o) :is(table,.rp-card) :is(td,th){vertical-align:middle!important}
@supports (line-height:calc(round(.5em,1px))) and selector(:has(a)){
  html:not(#o):not(#o):not(#o):not(#o) table :is(td,th):not(.pl-pair){
    line-height:calc(round(.96875em,1px) + round(.2412em,1px))!important}
  /* e = (ascent - descent)/2 - cap/2 of the rounded line box = how far the cap centre sits below the line-box centre; margin-top -2e */
  html:not(#o):not(#o):not(#o):not(#o) table :is(td,th):not([data-col],.pl-pair)::before{
    content:"";display:block;height:0;
    margin-top:calc(.7275em - (round(.96875em,1px) - round(.2412em,1px)))}
  /* children keep their own font's exact line box; glyph children are zero-height so a big glyph cannot push the text off centre */
  html:not(#o):not(#o):not(#o):not(#o) table :is(td,th) :is(span,i,b,em,strong,small,sup,sub,u,a,label){
    line-height:calc(round(.96875em,1px) + round(.2412em,1px))}
  html:not(#o):not(#o):not(#o):not(#o) table :is(td,th) :is(.gl,.lg-g,.lg-src,.ctl-sym,.ahl-g,.ci-g,.pr-g,.helio-ev-mark){line-height:0!important}
}

/* Non-button labels, summaries, chips and badges (settings checkboxes, details headers, pills made from spans / labels): the same
   leading-free line box; flex and inline-flex ones already centre their line box, so the fractional line-height was the only offset. */
@supports (line-height:calc(round(.5em,1px))) and selector(:has(a)){
  html:not(#o):not(#o):not(#o):not(#o) :is(label.set-check,label.wd-check,label.direph-pill,.set-sec > summary,.ci-badge,.lib-badge,.ident-badge,.pl-chip,.hp-chip,.wd-chip,.obr-chip,.dmo-chip,.dlab-recipe-badge,.dlab-pill-badge,.dlab-grammar-badge){
    line-height:calc(round(.96875em,1px) + round(.2412em,1px))!important}
}

/* Settings section headers (flex summary, 7px padding): the cap-centre correction of control-centring.css, applied through padding. */
html:not(#o){--sum-pad-y:7px;--sum-ink:.36375em}
@supports (line-height:calc(round(.5em,1px))) and selector(:has(a)){
  html:not(#o):not(#o):not(#o):not(#o) details.set-sec > summary{
    padding-block-start:calc(var(--sum-pad-y) + max(0px, 2 * var(--sum-ink) - (round(.96875em,1px) - round(.2412em,1px))))!important;
    padding-block-end:calc(var(--sum-pad-y) + max(0px, (round(.96875em,1px) - round(.2412em,1px)) - 2 * var(--sum-ink)))!important}
}
