/*
 * HDS scope overrides
 * -------------------
 * HDS "common.css" (loaded globally from the CDN in index.html) is a document-level
 * base/reset. Its bare-element rules leak into the legacy app and conflict with the
 * legacy resets. The most visible symptom is lists: common.css applies
 *     ul, ol { padding: 0; margin: 0 0 <sl-spacing-small> 2rem; }
 *     ul     { list-style: disc; }
 * which adds bullets + indentation to every list in the app.
 *
 * The new app-header renders its menus with Shoelace web components (<sl-menu> etc.)
 * inside Shadow DOM, so document-level element rules never reach them. That means the
 * header does NOT rely on common.css's list styling, and we can safely re-assert the
 * legacy list reset everywhere EXCEPT inside the header.
 *
 * We scope by EXCLUDING the header subtree (.nav-header-wrapper, the app-header root)
 * rather than by INCLUDING <router-view>, so this also covers content rendered outside
 * router-view: dialogs/popups/dropdowns appended to <body>, and the sibling widgets in
 * app.html (zen-desk, pendo, ni-assistant, ...). A plain `router-view ul {}` rule would
 * miss all of those.
 *
 * Specificity note: `ul:not(.nav-header-wrapper *)` is (0,1,1), which beats HDS's bare
 * `ul` / `ul,ol` (0,0,1) deterministically (HDS uses no !important). This is loaded
 * AFTER common.css so it also wins any same-specificity ties by source order.
 *
 * Requires a modern (evergreen) browser: :not() with a descendant selector.
 */

ul:not(.nav-header-wrapper *),
li:not(.nav-header-wrapper *),
ol:not(.nav-header-wrapper *) {
  margin-bottom: 0;
  margin-left: 0;
  list-style: none;
}

p:not(.nav-header-wrapper *) {
  margin-bottom: 15px;
}

/*
 * box-sizing leakage
 * ------------------
 * common.css applies:
 *     html { box-sizing: border-box; }
 *     *, *:before, *:after { box-sizing: inherit; }
 * The `inherit` lets box-sizing cascade from ancestors, so any legacy subtree that opts
 * out to content-box (styles.css has `box-sizing: initial` in places) propagates
 * content-box down and collapses layouts like `.info-block-c1` (`float; width:49.3%`).
 *
 * The legacy app's own reset (styles.css) sets `*, *:before, *:after { box-sizing:
 * border-box; }`, so we simply re-assert that legacy value everywhere EXCEPT inside the
 * header — restoring the pre-HDS behaviour without touching the Shoelace app-header.
 *
 * Specificity note: `:not()` takes the specificity of its argument, so
 * `*:not(.nav-header-wrapper *)` is (0,1,0) and beats common.css's bare `*` (0,0,0);
 * the ::before/::after variants are (0,1,1) and beat common.css's `*:before`/`*:after`.
 */
*:not(.nav-header-wrapper *),
*:not(.nav-header-wrapper *)::before,
*:not(.nav-header-wrapper *)::after {
  box-sizing: border-box;
}
