/* THE IMPERIAL / METRIC CONTROL (unit-control.mjs; SPEC-sitelines-display-units-2026-10-02 R1). One segmented control: two real buttons, the pressed one filled.
   In the workspace chrome row (every shell below the desktop bar) it takes the whole row under Look and Theme, which that row's two-column grid would otherwise
   push to a ragged third cell; at the desktop shell the top bar adopts the same node into .topbar-units and it is one 36 px control among the bar's others. */
.unit-control{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.workspace-chrome .unit-control{grid-column:1 / -1}
.unit-control-label{font-size:13px;color:var(--ink-subtle)}
.unit-control-choice{font:inherit;font-size:13px;color:var(--ink);background:var(--s1);border:1px solid var(--hair-strong);min-height:44px;padding:0 12px;cursor:pointer;margin:0;border-radius:0}
.unit-control-choice:first-of-type{border-radius:6px 0 0 6px}
.unit-control-choice:last-of-type{border-radius:0 6px 6px 0;margin-left:-1px}
.unit-control-choice:hover{background:var(--s2)}
.unit-control-choice[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
.unit-control-choice:focus-visible{outline:var(--focus-width) solid var(--focus-ink);outline-offset:var(--focus-offset)}
.unit-control-status{font-size:12px;color:var(--ink-subtle);flex:1 1 100%;margin:0}
.unit-control-status:empty{display:none}
.workspace-chrome .unit-control-choice{height:auto;min-height:44px}
.topbar-units{display:none}
@media screen and (min-width:1024px){
 body[data-topbar=on] .topbar-units{display:flex;flex:none;align-items:center;margin:0 4px 0 0;position:relative}
 body[data-topbar=on] .topbar-units .unit-control{flex-wrap:nowrap}
 body[data-topbar=on] .topbar-units .unit-control-choice{min-height:36px;padding:0 10px}
 /* the sentence a switch speaks does not widen the bar: it hangs under the control, over the column, for the few seconds it is read */
 body[data-topbar=on] .topbar-units .unit-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{.unit-control,.topbar-units{display:none!important}}
