/* Rules every page needs, moved out of the views. The fonts themselves are set in tailwind.config.js. */
[x-cloak] { display: none !important; }
.tabular-nums, .font-mono, table { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, .4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(156, 163, 175, .7); }

/* chart of accounts: the compact tree and its tabs */
body:has(.drawer-tab) { font-size: 11px; }
.drawer-tab {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  user-select: none;
  word-break: break-word;
  line-height: 1.25;
}

/* Muted helper text stays legible on light pages, and form controls without their own background classes follow
   the dark theme (zero-specificity :where() keeps every explicit utility class winning). */
:where(html:not(.dark)) :where(main) .text-zinc-400:not(.bg-zinc-900 .text-zinc-400):not(.bg-zinc-800 .text-zinc-400):not(.bg-zinc-950 .text-zinc-400):not(.bg-black .text-zinc-400) { color: #71717a; }
:where(html.dark) :where(main) :where(input, select, textarea):not([class*="bg-"]):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]) { background-color: #27272a; color: #f4f4f5; border-color: #3f3f46; }
:where(html.dark) :where(main) :where(input, select, textarea):where(.bg-white, .bg-zinc-50, .bg-zinc-100):not([class*="dark:bg"]):not([type=checkbox]):not([type=radio]) { background-color: #27272a; color: #f4f4f5; border-color: #3f3f46; }
:where(html.dark) :where(main) :where(tr, th, td):where([class*="text-zinc-5"], [class*="text-zinc-6"], [class*="text-zinc-7"]):not([class*="dark:text"]) { color: #d4d4d8; }
/* column headers stay on one line; wide tables scroll inside their container instead */
:where(main) th { white-space: nowrap; }
/* line-grid cells: a control never grows wider than its column */
:where(main) td :where(input, select, textarea) { max-width: 100%; }
:where(main) td :where(.flex) > :where(input, select) { min-width: 0; flex: 1 1 auto; }
:where(main) td :where(.flex) > button { flex-shrink: 0; }
