/* Density (Design… window, Settings > Display; remembered per device): Comfortable is the layout as it is; Compact and Dense scale the whole interface down so more fits
   on an iPad. `zoom` scales text, spacing and the 44px touch rows together; the heights in vh must be divided by it or the page ends short of the screen. */
html[data-density="compact"] { --dz: .84; --nav-h: 34px; --cal-row: 28px; }
html[data-density="dense"] { --dz: .76; --nav-h: 28px; --cal-row: 22px; }
html[data-density] { zoom: var(--dz); }
html[data-density] #app { min-height: calc(100vh / var(--dz)); }
html[data-density] #side, html[data-density] #resizer, html[data-density] #siderail { height: calc(100vh / var(--dz)); }
html[data-density] #main.fixed { height: calc(100vh / var(--dz)); }
html[data-density][data-design=paper] #side { height: calc(100vh / var(--dz) - 24px); }
html[data-density][data-design=topnav] #side { height: auto; }
html[data-density][data-design=topnav] #main.fixed { height: calc(100vh / var(--dz) - var(--top-h, 100px)); }
html.mobile[data-density] #app { min-height: calc(100dvh / var(--dz)); }
@media (pointer: coarse) {
  html[data-density] :is(#nav a, .acc, .ent, .grp, #acc-head) { min-height: calc(var(--nav-h) / var(--dz)); }
  html[data-density] :is(.cal-tx, .cal-more) { min-height: calc(var(--cal-row) / var(--dz)); }
}
.dens-seg { display: flex; gap: 6px; margin: 0 0 14px; }
.dens-seg button { flex: 1; }
.dens-seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Pop-ups that script places on the page (the suggestion lists, the ⋮ menu, the category picker, the calculator) are given screen pixels measured with
   getBoundingClientRect(); the page's zoom would scale those positions again and drop the list on top of the box it belongs to. They cancel the zoom, so they land
   where they were measured (and are drawn at the normal size, which is also easier to tap). A new pop-up that is placed from a measurement belongs in this list. */
html[data-density] :is(#paysug, #tagsug, #rowmenu, #pickpanel, #calcbox, #homedrop, #homeghost) { zoom: calc(1 / var(--dz)); }
