/* THE EXPLAIN PREFERENCE (explain.mjs; v0.5.33 expert view R1).
   OFF is the default and the state of a page whose script has not set the attribute: every [data-explainer] element (a definition of a standard term or a
   note on how the screen works) is out of layout unless <html data-explanations=on>. Caveats, refusals and sources never carry the mark. */
html:not([data-explanations=on]) [data-explainer]:not([data-explainer-open]){display:none!important}
/* With Explain OFF each hidden explanation keeps a "?" button where it was (explain-control.mjs mountExplainerReveal): one press opens that one item.
   With Explain ON the text is inline, so the button goes. Complete border, visible focus ring, no fill: it is a quiet control beside the text it opens. */
.explainer-reveal{display:inline-flex;align-items:center;justify-content:center;font:inherit;font-size:11px;font-weight:600;line-height:1;color:var(--ink-subtle);background:transparent;border:1px solid var(--hair-strong);border-radius:999px;min-width:20px;height:20px;padding:0 5px;margin:0 4px;vertical-align:middle;cursor:pointer}
.explainer-reveal:hover{color:var(--ink);background:var(--s2)}
.explainer-reveal[aria-expanded=true]{color:var(--ink);border-color:var(--ink-subtle)}
.explainer-reveal:focus-visible{outline:var(--focus-width) solid var(--focus-ink);outline-offset:var(--focus-offset)}
html[data-explanations=on] .explainer-reveal{display:none!important}
/* A note the sheet has folded (assumption-sheet.mjs settleNotes) is already behind the row's own toggle, and that toggle is the reader asking for the note:
   opening the fold shows every note in it, explanations included, so the fold needs no ? of its own (one press, not two). */
.sheet-row .sheet-folded + .explainer-reveal{display:none}
html:not([data-explanations=on]) .sheet-row[data-note-open=true] .sheet-folded[data-explainer]{display:block!important}
/* In a desktop sheet row the ? sits on the row's own line, at the end of the name cell, so a row hiding its explanation is no taller than a row that has none
   (the assumption sheet's one-line budget; the attribute outranks the sheet's rule that drops every other child of a row to its own line). The opened explanation still drops under the line, where the note always sat. */
@media screen and (min-width:1024px){
 .sheet-row>.explainer-reveal[data-explainer-reveal]{grid-column:1;grid-row:1;justify-self:end;margin:0 4px 0 0}
 /* A checkbox row's note sits inside its label, which lays out as part of the row (display:contents), so its "?" is placed the same way. Left to
    auto-placement it fell into the zero-width fourth column at a narrow inspector and lay over the Source chip. */
 .sheet-row>.sheet-check>.explainer-reveal[data-explainer-reveal]{grid-column:1;grid-row:1;justify-self:end;margin:0 4px 0 0}
 /* The room for the "?" is a margin, not padding: padding made it part of the name's own box, so the "?" sat on the name (the R3 narrow-inspector
    check found row name and "?" overlapping on every row that has one). */
 html:not([data-explanations=on]) .sheet-row:is(:has(>.explainer-reveal),:has(>.sheet-check>.explainer-reveal))>.row-name{margin-right:30px}
}
/* At a narrow inspector a select or gradient row's name spans the first four columns (workspace.css @container sheet); the "?" ends where the name
   ends, not at the end of the first column under the name's words. */
@media screen and (min-width:1024px){
 @container sheet (max-width:448px){
  .sheet-row:is([data-sheet-layout=select],[data-sheet-layout=gradient])>.explainer-reveal[data-explainer-reveal]{grid-column:1 / 5}
 }
}
/* On the phone the button itself is the 44 x 44 target every control there must be (it was a 28 px wide pill stretched to 44 px tall, under the bar).
   The visible mark stays a 28 px circle drawn inside it, so the layout gains 8 px of width, not a 44 px badge: the box carries no border or fill of its
   own; the circle carries the complete border, the hover fill and the open state. The focus ring stays on the button's own 44 px box. */
body[data-shell=mobile] .explainer-reveal{position:relative;isolation:isolate;box-sizing:border-box;min-width:44px;width:44px;height:44px;padding:0;margin:0;border:0;background:transparent;font-size:13px}
body[data-shell=mobile] .explainer-reveal::before{content:'';position:absolute;left:50%;top:50%;width:28px;height:28px;margin:-14px 0 0 -14px;box-sizing:border-box;border:1px solid var(--hair-strong);border-radius:999px;pointer-events:none;z-index:-1}
body[data-shell=mobile] .explainer-reveal:hover{background:transparent}
body[data-shell=mobile] .explainer-reveal:hover::before{background:var(--s2)}
body[data-shell=mobile] .explainer-reveal[aria-expanded=true]::before{border-color:var(--ink-subtle)}

/* The control: one toggle button beside the Imperial / Metric control, the same 44 px target (36 px in the desktop bar) and the same complete border. */
.explain-control{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.workspace-chrome .explain-control{grid-column:1 / -1}
/* Below the desktop bar (the chrome row is the phone and compact shells' own) Units and Explain share one line, Look and Theme the next, as the row was before
   R1 added a third line: at 390 px the extra line, with the header's "?" below, pushed "See the building in 3D" and the Key inputs route out of the first
   frame (correctness review of 10228383, LOW-5). The two controls keep their 44 px targets; the status sentence wraps under them while it is showing. */
.workspace-chrome:has(>.unit-control + .explain-control){display:flex;flex-wrap:wrap;align-items:center}
.workspace-chrome:has(>.unit-control + .explain-control)>:is(.unit-control,.explain-control){flex:0 0 auto}
.workspace-chrome:has(>.unit-control + .explain-control)>:not(.unit-control,.explain-control){flex:0 0 auto;min-width:145px}
/* The header's intro is an explanation; its "?" sits on the title's line, not on a line of its own. Opened, the intro drops under both. */
header:has(>.explainer-reveal){display:flex;flex-wrap:wrap;align-items:center;column-gap:4px}
header:has(>.explainer-reveal)>h1{order:0;margin-bottom:0}
header:has(>.explainer-reveal)>.explainer-reveal{order:1}
header:has(>.explainer-reveal)>:not(h1,.explainer-reveal){order:2;flex:1 1 100%}
/* v0.5.34 live check (L3): the same for a panel whose heading is followed by its explanation ("Where the numbers come from"): the "?" sat alone on a line
   under the heading and read as a stray button. It sits on the heading's line; opened, the explanation drops under the heading, and the rest of the panel
   keeps its order below. */
.panel:has(>h3:first-child+[data-explainer]+.explainer-reveal){display:flex;flex-wrap:wrap;align-items:center;column-gap:6px}
.panel:has(>h3:first-child+[data-explainer]+.explainer-reveal)>h3:first-child{order:0;flex:0 1 auto;min-width:0}
.panel:has(>h3:first-child+[data-explainer]+.explainer-reveal)>h3:first-child+[data-explainer]+.explainer-reveal{order:1;flex:none}
.panel:has(>h3:first-child+[data-explainer]+.explainer-reveal)>:not(h3:first-child,h3:first-child+[data-explainer]+.explainer-reveal){order:2;flex:1 1 100%;min-width:0}
.explain-control-toggle{font:inherit;font-size:13px;color:var(--ink);background:var(--s1);border:1px solid var(--hair-strong);border-radius:6px;min-height:44px;padding:0 12px;cursor:pointer;margin:0}
.explain-control-toggle:hover{background:var(--s2)}
.explain-control-toggle[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
.explain-control-toggle:focus-visible{outline:var(--focus-width) solid var(--focus-ink);outline-offset:var(--focus-offset)}
.explain-control-status{font-size:12px;color:var(--ink-subtle);flex:1 1 100%;margin:0}
.explain-control-status:empty{display:none}
.workspace-chrome .explain-control-toggle{height:auto;min-height:44px}
@media screen and (min-width:1024px){
 body[data-topbar=on] .topbar-units{gap:8px}
 body[data-topbar=on] .topbar-units .explain-control{flex-wrap:nowrap;position:relative}
 body[data-topbar=on] .topbar-units .explain-control-toggle{min-height:36px;padding:0 10px}
 /* the sentence a switch speaks hangs under the control, as the units sentence does, so the bar never widens */
 body[data-topbar=on] .topbar-units .explain-control-status{position:absolute;top:calc(100% + 2px);right:0;z-index:1600;pointer-events:none;width:max-content;max-width:min(380px,40vw);padding:6px 10px;background:var(--dock-fill);border:1px solid var(--dock-stroke);border-radius:6px;color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.12)}
}
@media print{.explain-control,.explainer-reveal{display:none!important}}
/* v0.5.55 (visual review H5): a "?" for a hidden note under a heading sits at the end of the heading's line, not alone on a row of its own. The header's
   lede is the page's own introduction; on the desktop shell, where the brand is in the top bar, its "?" had no label beside it and is not shown. */
html:not([data-explanations=on]) h3 + [data-explainer]:not([data-explainer-open]) + .explainer-reveal{float:right;align-self:flex-end;position:relative;top:-30px;margin:0 0 -20px 8px}
html:not([data-explanations=on]) body[data-topbar=on] header > [data-explainer]:not([data-explainer-open]) + .explainer-reveal{display:none}
