/* One control scale for the whole site (approved 2026-11-13).
   Three heights only: bar (top bar and main calls to action), standard (buttons and fields), small (row actions, filters, chips).
   Desktop 36 / 32 / 28, phone 40 / 36 / 32. Loaded last on every page; the :not(#_#_#_) prefix outranks the older layers. */
:root { --ctl-bar: 36px; --ctl-std: 32px; --ctl-sm: 28px; --ctl-fs: 13px; --ctl-fs-sm: 12.5px; }
@media (max-width: 760px) { :root { --ctl-bar: 40px; --ctl-std: 36px; --ctl-sm: 32px; --ctl-fs: 14px; --ctl-fs-sm: 13px; } }

/* ---------- OwnerHub ---------- */
html:root body[data-mode=admin]:not(#_#_#_) .topbar :is(.topbar-tools, #pageTools) > :is(.text-button, .lang, .btn, .top-search, .theme-toggle, button, a),
html:root body[data-mode=admin]:not(#_#_#_) .topbar #menuToggle,
html:root body[data-mode=admin]:not(#_#_#_) #sidebar .drawer-tools > *,
html:root body[data-mode=admin]:not(#_#_#_) .mobile-subbar #pageTools > * {
  height: var(--ctl-bar) !important; min-height: var(--ctl-bar) !important; padding-block: 0 !important; font-size: var(--ctl-fs) !important;
}
html:root body[data-mode=admin]:not(#_#_#_) .topbar :is(.topbar-tools, #pageTools) > :is(.text-button, .lang, .btn, button, a):not(.theme-toggle):not(.btn-icon) { padding-inline: 14px !important; }

html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(.btn, .chat-hist-toggle, .chat-tab, .chat-tab-add, .mb-ib, .mb-search),
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]), select),
html:root body[data-mode=admin]:not(#_#_#_) .mb-folders .hl-mail-rail button {
  height: var(--ctl-std) !important; min-height: var(--ctl-std) !important; padding-block: 0 !important;
}
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(.btn, .chat-hist-toggle, .chat-tab, .chat-tab-add) { font-size: var(--ctl-fs) !important; }
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) .btn:not(.btn-icon) { padding-inline: 14px !important; }
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) select { line-height: normal !important; }
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(.mb-ib, .chat-tab-add, .btn-icon) { width: var(--ctl-std) !important; min-width: var(--ctl-std) !important; padding: 0 !important; }

/* small: filters, tabs, chips and the small buttons outside rows */
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(.btn.small, .tabs > button.tab, .mb-chip, .mb-fbtn, .chat-tools .btn, .file-pick .btn) {
  height: var(--ctl-sm) !important; min-height: var(--ctl-sm) !important; padding: 0 12px !important; font-size: var(--ctl-fs-sm) !important;
}
/* chips may wrap to two lines, so they only get a minimum height */
html:root body[data-mode=admin]:not(#_#_#_) :is(#view, #dialog) :is(.skill-chip, .ai-q, .cp-quick .btn, .cp-quick .ai-q) {
  height: auto !important; min-height: var(--ctl-sm) !important; padding: 4px 12px !important; line-height: 1.3 !important; font-size: var(--ctl-fs-sm) !important;
}
/* row actions stay at the standard height, level with the row's main button */
html:root body[data-mode=admin]:not(#_#_#_) #view :is(.quick-acts, .list-row, .pf-actions, .compose-bar) .btn.small {
  height: var(--ctl-std) !important; min-height: var(--ctl-std) !important; padding: 0 14px !important; font-size: var(--ctl-fs) !important;
}
@media (min-width: 761px) {
  html:root body[data-mode=admin]:not(#_#_#_) .topbar :is(.topbar-tools, #pageTools) > :is(.theme-toggle, .btn-icon) { width: var(--ctl-bar) !important; min-width: var(--ctl-bar) !important; padding: 0 !important; }
}

/* ---------- Investor portal ---------- */
html:root body:not(#_#_#_) #portalShell .topbar-tools > :is(.text-button, .role-select, .lang-button, .theme-toggle),
html:root body:not(#_#_#_) #portalShell .topbar .mobile-menu-btn,
html:root body:not(#_#_#_) #portalShell .drawer-tools > :is(.text-button, .role-select),
html:root body:not(#_#_#_) #portalShell .page-content :is(.action-button, .secondary-button):not(.small),
html:root body:not(#_#_#_) #portalShell .page-content :is(.chart-tab, .chart-download),
html:root body:not(#_#_#_) #portalShell .page-content #fundingAmount {
  height: var(--ctl-bar) !important; min-height: var(--ctl-bar) !important; padding-block: 0 !important; font-size: var(--ctl-fs) !important;
}
html:root body:not(#_#_#_) #portalShell .topbar-tools > .role-select,
html:root body:not(#_#_#_) #portalShell .drawer-tools > .role-select { line-height: normal !important; }
html:root body:not(#_#_#_) #portalShell .topbar-tools > :is(.text-button, .lang-button) { padding-inline: 14px !important; }
html:root body:not(#_#_#_) #portalShell .page-content :is(.action-button, .secondary-button):not(.small) { padding-inline: 16px !important; }
html:root body:not(#_#_#_) #portalShell .page-content :is(.plan-tab, .secondary-button.small, .action-button.small, .cmp-switch button) {
  height: var(--ctl-std) !important; min-height: var(--ctl-std) !important; padding-block: 0 !important; font-size: var(--ctl-fs) !important;
}
@media (min-width: 761px) {
  html:root body:not(#_#_#_) #portalShell .topbar-tools > .theme-toggle { width: var(--ctl-bar) !important; min-width: var(--ctl-bar) !important; }
  html:root body:not(#_#_#_) #navigation .nav-link.group-link { min-height: 40px !important; height: 40px !important; padding-block: 0 !important; font-size: 15px !important; display: flex !important; align-items: center !important; }
}

/* ---------- Public site and sign-in ---------- */
html:root body:is(.public-site, .login-site):not(#_#_#_) :is(.header-actions, .footer-links, .hero-actions) > :is(.button, .locale-button, .theme-toggle),
html:root body:is(.public-site, .login-site):not(#_#_#_) .nav-extras .locale-button,
html:root body:is(.public-site, .login-site):not(#_#_#_) .passkey-actions .auth-choice {
  height: var(--ctl-bar) !important; min-height: var(--ctl-bar) !important; padding-block: 0 !important; font-size: var(--ctl-fs) !important; line-height: 1.2 !important;
}
html:root body:is(.public-site, .login-site):not(#_#_#_) main :is(.button, .login-text-button):not(.auth-choice),
html:root body:is(.public-site, .login-site):not(#_#_#_) main :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select) {
  height: var(--ctl-std) !important; min-height: var(--ctl-std) !important; padding-block: 0 !important;
}
html:root body:is(.public-site, .login-site):not(#_#_#_) main :is(.button, .login-text-button):not(.auth-choice) { font-size: var(--ctl-fs) !important; line-height: 1.2 !important; }
html:root body:is(.public-site, .login-site):not(#_#_#_) main select { line-height: normal !important; }
html:root body:is(.public-site, .login-site):not(#_#_#_) main .hero-actions > .button { height: var(--ctl-bar) !important; min-height: var(--ctl-bar) !important; }
html:root body[data-mode=admin]:not(#_#_#_) #view .chat-tab > button:not(.chat-tab-x) { height: 100% !important; min-height: 0 !important; padding-block: 0 !important; font-size: var(--ctl-fs) !important; }
