/*
 * Borem Core UI isolation layer.
 *
 * Loaded after third-party/template CSS and before Borem component CSS.  The
 * reset deliberately has low specificity so Borem's component rules remain
 * authoritative while WordPress theme rules are removed from the app tree.
 */

:where(.borem-app, .borem-ui-root, .borem-preloader),
:where(.borem-app, .borem-ui-root, .borem-preloader) :where(
  a, abbr, address, area, article, aside, audio,
  b, bdi, bdo, blockquote, br, button,
  canvas, caption, cite, code, col, colgroup,
  data, datalist, dd, del, details, dfn, dialog, div, dl, dt,
  em, embed,
  fieldset, figcaption, figure, footer, form,
  h1, h2, h3, h4, h5, h6, header, hgroup, hr,
  i, iframe, img, input, ins,
  kbd,
  label, legend, li, link,
  main, map, mark, menu, meter,
  nav, noscript,
  object, ol, optgroup, option, output,
  p, picture, pre, progress,
  q,
  ruby,
  s, samp, search, section, select, slot, small, source, span, strong, sub, summary, sup,
  table, tbody, td, template, textarea, tfoot, th, thead, time, tr, track,
  u, ul,
  var, video,
  wbr
) {
  all: revert;
  box-sizing: border-box;
}

:where(.borem-app, .borem-ui-root, .borem-preloader) :where(*, *::before, *::after) {
  box-sizing: border-box;
}

/* Neutralize decorative pseudo-elements supplied by common WordPress themes.
   Borem component CSS is loaded later and can intentionally add them back. */
:where(.borem-app, .borem-ui-root) :where(a, button, input, select, textarea, label, summary)::before,
:where(.borem-app, .borem-ui-root) :where(a, button, input, select, textarea, label, summary)::after {
  content: none;
}

:where(.borem-app, .borem-ui-root) {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
  text-indent: 0;
  text-transform: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.borem-app, .borem-ui-root)[data-borem-theme="dark"],
[data-borem-theme="dark"] :where(.borem-ui-root) {
  color-scheme: dark;
}

:where(.borem-app, .borem-ui-root) :where(div, section, article, aside, header, footer, main, nav, form, fieldset) {
  min-width: 0;
}

:where(.borem-app, .borem-ui-root) :where(h1, h2, h3, h4, h5, h6, p, blockquote, figure, pre, dl, dd) {
  margin: 0;
}

:where(.borem-app, .borem-ui-root) :where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.borem-app, .borem-ui-root) :where(h1, h2, h3, h4, h5, h6, strong, b, label, legend, th) {
  color: inherit;
  font-family: inherit;
}

:where(.borem-app, .borem-ui-root) h1 { font-size: 2rem; line-height: 1.2; font-weight: 750; }
:where(.borem-app, .borem-ui-root) h2 { font-size: 1.5rem; line-height: 1.25; font-weight: 750; }
:where(.borem-app, .borem-ui-root) h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
:where(.borem-app, .borem-ui-root) h4 { font-size: 1rem; line-height: 1.35; font-weight: 700; }
:where(.borem-app, .borem-ui-root) h5,
:where(.borem-app, .borem-ui-root) h6 { font-size: .875rem; line-height: 1.4; font-weight: 700; }

:where(.borem-app, .borem-ui-root) :where(a, a:visited) {
  color: #1769aa;
  text-decoration: none;
  text-decoration-thickness: auto;
  text-underline-offset: auto;
}
:where(.borem-app, .borem-ui-root) a:hover { color: #0e5f9f; text-decoration: underline; }

:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea, optgroup, option) {
  font-family: inherit;
  font-size: inherit;
  font-style: normal;
  font-weight: inherit;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
}

:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea) {
  margin: 0;
  max-width: 100%;
  border: 1px solid #ccd7e3;
  border-radius: 8px;
  background-color: #fff;
  background-image: none;
  color: #1c2733;
  box-shadow: none;
  outline: 0;
}

:where(.borem-app, .borem-ui-root) :where(
  input:not([type]),
  input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"],
  input[type="password"], input[type="number"], input[type="date"], input[type="time"],
  input[type="datetime-local"], input[type="month"], input[type="week"],
  select, textarea
) {
  width: auto;
  min-height: 38px;
  padding: 8px 10px;
}

:where(.borem-app, .borem-ui-root) textarea {
  min-height: 82px;
  resize: vertical;
}

:where(.borem-app, .borem-ui-root) select {
  -webkit-appearance: auto;
  appearance: auto;
  cursor: pointer;
}

:where(.borem-app, .borem-ui-root) :where(option, optgroup) {
  background-color: #fff;
  color: #1c2733;
}

:where(.borem-app, .borem-ui-root) option:checked {
  background-color: #dcecff;
  color: #0f4f83;
}

:where(.borem-app, .borem-ui-root) :where(input[type="checkbox"], input[type="radio"]) {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: var(--borem-app-accent, var(--st-orange, #f05a28));
  vertical-align: middle;
}
:where(.borem-app, .borem-ui-root) input[type="radio"] { border-radius: 50%; }

:where(.borem-app, .borem-ui-root) input[type="file"] {
  min-height: 38px;
  padding: 4px;
  cursor: pointer;
}
:where(.borem-app, .borem-ui-root) input[type="file"]::file-selector-button {
  margin: -1px 8px -1px -1px;
  padding: 7px 10px;
  border: 1px solid #ccd7e3;
  border-radius: 7px;
  background: #f7f9fc;
  color: #27445f;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

:where(.borem-app, .borem-ui-root) button {
  -webkit-appearance: none;
  appearance: none;
  min-height: 36px;
  padding: 7px 12px;
  cursor: pointer;
  text-align: center;
}

:where(.borem-app, .borem-ui-root) :where(input, textarea)::placeholder {
  color: #8190a1;
  opacity: 1;
}

:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea):focus {
  border-color: var(--borem-app-accent, var(--st-orange, #f05a28));
  box-shadow: 0 0 0 3px rgba(240, 90, 40, .12);
  outline: 0;
}

:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea):focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea):disabled,
:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

:where(.borem-app, .borem-ui-root) fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
:where(.borem-app, .borem-ui-root) legend { margin: 0 0 6px; padding: 0; font-weight: 700; }
:where(.borem-app, .borem-ui-root) label { display: inline-block; margin: 0; cursor: default; }

:where(.borem-app, .borem-ui-root) table {
  width: auto;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  color: inherit;
  table-layout: auto;
}
:where(.borem-app, .borem-ui-root) :where(th, td) {
  height: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: none;
  vertical-align: top;
}

:where(.borem-app, .borem-ui-root) details { display: block; }
:where(.borem-app, .borem-ui-root) summary { display: list-item; cursor: pointer; }
:where(.borem-app, .borem-ui-root) hr { height: 1px; margin: 16px 0; border: 0; background: #e0e4e8; }
:where(.borem-app, .borem-ui-root) img { height: auto; max-width: 100%; border: 0; }
:where(.borem-app, .borem-ui-root) iframe { max-width: 100%; border: 0; }
:where(.borem-app, .borem-ui-root) code,
:where(.borem-app, .borem-ui-root) kbd,
:where(.borem-app, .borem-ui-root) samp,
:where(.borem-app, .borem-ui-root) pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

:where(.borem-app, .borem-ui-root) [hidden] { display: none !important; }

:where(.borem-app, .borem-ui-root) ::selection {
  background: rgba(23, 105, 170, .22);
  color: inherit;
}

/* The active theme often places shortcode output inside a constrained article,
   content or builder wrapper.  JavaScript marks only the app's ancestor chain
   with this class; these rules remove layout constraints without touching
   unrelated theme elements. */
html.borem-app-document,
body.borem-app-host {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f4f6f8 !important;
}

body.borem-app-host > .borem-app-host-shell,
body.borem-app-host .borem-app-host-shell {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

body.borem-app-host.borem-tech-modal-open,
body.borem-app-host.borem-location-modal-open,
body.borem-app-host.borem-wo-create-open,
body.borem-app-host.borem-wo-filter-open {
  overflow: hidden !important;
}

/* Hardening for the properties themes most frequently mark !important.
   Component-specific Borem rules continue to own sizing, color and layout. */
:where(.borem-app, .borem-ui-root) :where(button, input, select, textarea, optgroup, option) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-style: normal !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

:where(.borem-app, .borem-ui-root) :where(a, button) {
  text-shadow: none !important;
}

:where(.borem-app, .borem-ui-root) :where(input, select, textarea) {
  -webkit-text-fill-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  :where(.borem-app, .borem-ui-root) *,
  :where(.borem-app, .borem-ui-root) *::before,
  :where(.borem-app, .borem-ui-root) *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
