/* ═══════════════════════════════════════════════════════════════════════
   oms-rd-scale.css — desktop 90% scale for the three portals
   (admin-new.html, factory-new.html, customers.html only).

   The owner: "when i zoom the page to 90% everything fits a lot better".
   The UI is thousands of inline px values, so a token rescale cannot do
   it; the whole document is zoomed instead, on desktop widths only
   (≥1100px). Phones and tablets are unchanged.

   ── SWITCH IT OFF (one place) ───────────────────────────────────────────
     • everywhere:    set  --rd-scale: 1;  in the :root rule below
     • one page/test: add class "rd-noscale" to <html>
   Everything else (viewport-unit tokens, the JS geometry shim in
   /js/oms-rd-scale.js) follows the computed zoom automatically.

   ── VIEWPORT UNITS UNDER ZOOM ───────────────────────────────────────────
   Inside a zoomed tree 100vh is scaled too, so a "full height" box comes
   up 10% short. Use these tokens instead of raw viewport units:
       height: var(--rd-vh, 100vh);
       height: calc(var(--rd-vh, 100vh) - 64px);
       max-height: calc(var(--rd-vh, 100vh) * .8);     (was 80vh)
   --rd-vh / --rd-dvh / --rd-vw are the usable viewport in the ZOOMED
   coordinate space, and equal plain 100vh / 100dvh / 100vw when the scale
   is off. The fallback keeps a rule working on pages that do not link
   this file (public token pages).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --rd-scale: .9;   /* ← the one switch: 1 = off */
    --rd-z: 1;        /* the zoom actually in force (set below) — read-only */
}

@media (min-width: 1100px) {
    html:not(.rd-noscale) { --rd-z: var(--rd-scale); }
}

html { zoom: var(--rd-z); }

:root {
    --rd-vh:  calc(100vh  / var(--rd-z));
    --rd-dvh: calc(100dvh / var(--rd-z));
    --rd-vw:  calc(100vw  / var(--rd-z));
}
/* A browser whose zoom does NOT scale viewport units (detected by
   oms-rd-scale.js) gets the plain units back. */
html.rd-vh-native {
    --rd-vh: 100vh;
    --rd-dvh: 100dvh;
    --rd-vw: 100vw;
}
