/* --- Shared UI: progressive enhancement helpers (SSOT) --- */
/* Policy:
   - SSR всегда отдаёт fallback (no-js-only) и улучшенную версию (js-only),
   - переключение видимости делаем только через классы на <html>, без [hidden],
   - base.js снимает .no-js и добавляет .js.
*/

html.no-js .js-only {
  display: none !important;
}

html.js .js-only:not(.hidden) {
  display: block !important;
}

/* Runtime visibility is authoritative in JS mode. Component and page styles
   are loaded later and must not resurrect controls hidden by application state. */
html.js .hidden {
  display: none !important;
}

/* Shell visibility is responsive rather than application state. Keep these
   exceptions compatible with both the previous and current server markup. */
@media (min-width: 64rem) {
  html.js #sidebar.hidden {
    display: flex !important;
  }
}

html.no-js .no-js-only {
  display: block !important;
}

html.js .no-js-only {
  display: none !important;
}

/* Combobox keeps a native select as its source of truth. */
html.no-js .cb-hidden-select,
html.no-js .cb-fallback-select {
  display: block !important;
}

html.js .cb-hidden-select,
html.js .cb-fallback-select {
  display: none !important;
}

/* Actions are unavailable when the enhancement scripts did not start. */
html.no-js [data-js-required-banner] {
  display: block !important;
}

html.no-js [data-js-required] {
  pointer-events: none;
  opacity: 0.55;
  cursor: not-allowed;
}

html.no-js [data-toggle="sidebar"] {
  display: none !important;
}
