/* ! Bullframe CSS v7.0.3 | MIT License | https://github.com/marcop135/bullframe.css  */

/* Classless build: semantic element styles only (no .bf-* classes). */

/* Variables */
/* Design tokens (--bf-*). Shared by every build variant.
 * Override on :root (or a scope) to theme without rebuilding. :where() keeps
 * these at zero specificity, so the dark :root block and your overrides win
 * whatever the load order (e.g. bullframe-utilities.css after a dark build). */

:where(:root) {
  /* Page */
  --bf-color-bg: rgb(255 255 255);
  --bf-color-text: rgb(34 34 34);
  --bf-color-text-muted: rgb(118 118 118);
  --bf-color-text-subtle: rgb(102 102 102);
  --bf-color-text-shadow: rgb(34 34 34);
  --bf-color-contrast: rgb(0 0 0);
  --bf-color-surface: rgb(233 233 233);
  --bf-color-border: rgb(204 204 204);
  --bf-color-border-strong: rgb(102 102 102);
  --bf-color-overlay-bg: rgb(255 255 255);
  --bf-color-caption: rgb(118 118 118);

  /* Primary */
  /* WCAG AA on white (links 4.5:1) and on-primary text (4.5:1). Links and
   * focused fields fall back to these unless --bf-color-link,
   * --bf-color-link-hover or --bf-color-field-border-focus is set. */
  --bf-color-primary: rgb(0 86 179);
  --bf-color-primary-hover: rgb(0 65 135);
  --bf-color-primary-subtle: rgb(190 216 254);
  --bf-color-primary-shadow-focus: rgb(0 65 135 / 35%);
  --bf-color-on-primary: rgb(255 255 255);

  /* Neutral buttons */
  --bf-color-neutral: rgb(204 204 204);
  --bf-color-neutral-hover: rgb(184 184 184);
  --bf-color-on-neutral: rgb(34 34 34);
  --bf-color-button-shadow-focus: rgb(0 0 0 / 15%);

  /* Form fields and controls */
  --bf-color-field-bg: rgb(255 255 255);
  --bf-color-field-border: rgb(138 138 138);
  --bf-color-field-shadow-focus: rgb(0 86 179 / 25%);
  --bf-color-placeholder: rgb(102 102 102);
  --bf-color-control-bg: rgb(255 255 255);
  --bf-color-control-border: rgb(138 138 138);
  --bf-color-range-track: rgb(233 233 233);
  --bf-color-progress-track: rgb(204 204 204);

  /* Highlight (mark / ins) */
  --bf-color-highlight: rgb(255 255 0);
  --bf-color-highlight-subtle: rgb(255 255 153);

  /* Invalid / error */
  --bf-color-danger: rgb(255 0 0);

  /* Tables */
  --bf-color-table-border: rgb(138 138 138);
  --bf-color-table-stripe: rgb(233 233 233);

  /* Focus ring (prefers-contrast: more raises colour for WCAG 1.4.11) */
  --bf-color-focus-ring: rgb(255 165 0);
  --bf-focus-ring-width: 0.2rem;
  --bf-focus-ring-offset: 0.3rem;

  /* Spacing scale + grid gutter */
  --bf-spacing-sm: 0.25rem;
  --bf-spacing-md: 0.5rem;
  --bf-spacing-lg: 1rem;
  --bf-spacing-xl: 2rem;
  --bf-spacing-xxl: 3rem;
  --bf-spacing-grid-gutter: 1.5rem;

  /* Type */
  --bf-font-sans-serif:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
  --bf-font-serif: Georgia, Times, 'Times New Roman', serif;
  --bf-font-monospace:
    SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --bf-body-font-size-rem: 1.6rem;
  --bf-body-line-height: 1.5;

  /* Breakpoint tokens (documentation / tooling; media queries use literal px below) */
  --bf-breakpoint-xs: 0;
  --bf-breakpoint-sm: 576px;
  --bf-breakpoint-md: 768px;
  --bf-breakpoint-lg: 992px;
  --bf-breakpoint-xl: 1200px;
  --bf-breakpoint-xxl: 1400px;
}

/* Layout */
/* Border-box and HTML5 block elements. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

article,
aside,
dialog,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
details {
  display: block;
}

template {
  display: none;
}

/* [hidden] stays hidden (except until-found). */
[hidden]:where(:not([hidden='until-found'])) {
  display: none !important;
}
/* UA+ enhancements (adapted from https://fokus.dev/tools/uaplus/).
 * Light UA improvements; complements Bullframe base styles. */

@layer {
  /* Disable mobile landscape text inflation on optimized layouts. */
  html {
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
         text-size-adjust: none;
  }

  /* Stable scrollbar gutter avoids layout jump on short pages. */
  @supports (scrollbar-gutter: stable) {
    html {
      scrollbar-gutter: stable;
    }
  }

  /* Nested h1 size/margin: match modern UA (Safari still nests sectioning styles). */
  h1 {
    font-size: 2em;
    margin-block: 0.67em;
  }

  /* mark: system Highlight colors under forced-colors. */
  @media (forced-colors: active) {
    mark {
      color: HighlightText;
      background-color: Highlight;
    }
  }

  /* Embedded media: stay within container block/inline size. */
  audio,
  iframe,
  img,
  svg,
  video {
    max-block-size: 100%;
    max-inline-size: 100%;
  }

  /* fieldset: avoid min-content overflow from children. */
  fieldset {
    min-inline-size: 0;
  }

  /* Labels for text-like controls are block; :has() gated for older engines. */
  @supports selector(:has(*)) {
    label:has(+ input:not([type='radio'], [type='checkbox']), select, textarea) {
      display: block;
    }
  }

  /* Taller default textarea when rows is omitted. */
  textarea:not([rows]) {
    min-block-size: 6em;
  }

  /* Form controls inherit page font family/size. */
  button,
  input,
  select,
  textarea {
    font-family: inherit;
    font-size: inherit;
  }

  /* Search: drop WebKit rounded search chrome. */
  [type='search'] {
    -webkit-appearance: textfield;
  }

  /* iOS only: system border/background for search. */
  @supports (-webkit-touch-callout: none) {
    [type='search'] {
      border: 1px solid -apple-system-secondary-label;
      background-color: canvas;
    }
  }

  /* Keep tel/url/email/number LTR when a value is present (RTL placeholders stay). */
  input:where([type='tel'], [type='url'], [type='email'], [type='number']):not(
      :-moz-placeholder
    ) {
    direction: ltr;
  }
  input:where([type='tel'], [type='url'], [type='email'], [type='number']):not(
      :placeholder-shown
    ) {
    direction: ltr;
  }

  /* Tables: outer border. Cell borders and padding come from
   * miscellaneous/tables.css, which is unlayered and therefore wins. */
  table {
    border: 1px solid currentColor;
  }

  /* Soft dialog / popover enter transitions (skip when reduced-motion is on). */
  @media (prefers-reduced-motion: no-preference) {
    dialog::backdrop {
      background: rgb(0 0 0 / 0.3);
    }

    @supports (overlay: auto) {
      dialog,
      [popover],
      dialog::backdrop {
        opacity: 0;
        transition:
          opacity 300ms ease-out,
          display 300ms allow-discrete,
          overlay 300ms allow-discrete;
      }

      dialog[open],
      :popover-open,
      dialog[open]::backdrop {
        opacity: 1;
      }

      @starting-style {
        dialog[open],
        :popover-open,
        dialog[open]::backdrop {
          opacity: 0;
        }
      }
    }
  }

  /* Images as blocks (max-width still from embedded-content.css). */
  img {
    display: block;
  }

  /* Popovers: anchor near trigger when position-area is supported. */
  @supports (position-area: block-end span-inline-end) {
    [popover] {
      margin: 0;
      position-area: block-end span-inline-end;
    }
  }
}

/* Typography */
/* Root type and page chrome. */

html {
  -webkit-text-size-adjust: 100%;
     -moz-text-size-adjust: 100%;
          text-size-adjust: 100%;

  /* 62.5% root so 1rem ≈ 10px. */
  font-size: 62.5%;

  color: var(--bf-color-text);
  font-family: system-ui, sans-serif;
  line-height: 1.15;

  /* No tap flash on touch. */
  -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
}

body {
  margin: 0;
  font-size: var(--bf-body-font-size-rem);
  line-height: var(--bf-body-line-height);
  font-weight: 400;
  text-align: left;

  /* System UI stack (OS-native). */
  font-family:
    /* Safari / iOS (San Francisco) */
    -apple-system,
    /* Chrome < 56 on macOS (San Francisco) */ BlinkMacSystemFont,
    /* Windows */ 'Segoe UI',
    /* Android */ Roboto,
    /* KDE */ Oxygen-Sans,
    /* Ubuntu */ Ubuntu,
    /* GNOME */ Cantarell,
    /* macOS 10.10 and below */ 'Helvetica Neue',
    Helvetica,
    /* Web fallback */ Arial,
    'Noto Sans',
    sans-serif,
    /* Emoji */ 'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji';

  /* Ligatures and kerning. */
  text-rendering: optimizeLegibility;

  /* Long unbroken strings (e.g. headlines) wrap instead of overflowing. */
  word-wrap: break-word;

  background-color: var(--bf-color-bg);
}
/* Heading scale and rhythm. */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  font-weight: 600;
  font-family: inherit;
  color: inherit;
  line-height: 1.25;
  margin-bottom: var(--bf-spacing-lg);
}

/* Balanced headings where supported; no-op elsewhere. */
@supports (text-wrap: balance) {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }
}

h1 {
  font-size: 36px;
  font-size: 3.6rem;
}

h2 {
  font-size: 30px;
  font-size: 3rem;
}

h3 {
  font-size: 24px;
  font-size: 2.4rem;
}

h4 {
  font-size: 20px;
  font-size: 2rem;
}

h5,
h6 {
  font-size: 16px;
  font-size: 1.6rem;
}
/* Blockquote and citation. */

blockquote {
  margin: 0 0 var(--bf-spacing-xl);
  padding-left: 0;
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
}

blockquote small {
  color: var(--bf-color-text-muted);
  display: block;
}

blockquote small::before {
  content: '\2014 \00A0';
}

q {
  quotes: '\201C' '\201D' '\2018' '\2019';
}
/* Paragraphs, abbr, mark/ins, emphasis, sub/sup, small, hr. */

p {
  margin: 0 0 var(--bf-spacing-xl) 0;
}

/* abbr (Bootstrap 4): dotted underline + help cursor. */
abbr[title],
abbr[data-original-title] {
  cursor: help;
  text-decoration: underline;
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
  border-bottom: 0;
}

mark {
  background-color: var(--bf-color-highlight);
  color: var(--bf-color-contrast);
}

ins {
  background-color: var(--bf-color-highlight-subtle);
  color: var(--bf-color-contrast);
  text-decoration: none;
}

/* Inherit first so Safari does not double-apply bolder, then set bolder. */
b,
strong {
  font-weight: inherit;
}

/* stylelint-disable-next-line no-duplicate-selectors -- normalize.css Safari fix */
b,
strong {
  font-weight: bolder;
}

dfn {
  font-style: italic;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -8px;
  top: -0.8rem;
}

sub {
  bottom: -4px;
  bottom: -0.4rem;
}

small {
  font-size: 80%;
}

/* Tighter leading when a paragraph contains <small>. */
@supports selector(:has(*)) {
  p:has(small) {
    line-height: 1.25;
  }
}

hr {
  box-sizing: content-box;
  display: block;
  height: 0;
  border-style: solid;
  border-width: 1px 0 0;
  color: inherit;
  margin: var(--bf-spacing-xl) 0;
  padding: 0;
  overflow: visible; /* Edge: show overflow. */
}
/* pre / code / kbd / samp. */

pre {
  margin: 0 0 var(--bf-spacing-xl) 0;

  display: block;
  overflow: auto;
  word-break: break-all; /* WebKit */
  word-wrap: break-word;
  white-space: pre;
  hyphens: none;

  /* Keep scrollbars visible in legacy Edge.
   * https://github.com/twbs/bootstrap/pull/30685 */
  -ms-overflow-style: auto;
}

pre,
code,
kbd,
samp {
  font-family:
    /* macOS 10.10+ */
    Menlo, Consolas, 'Roboto Mono', 'Ubuntu Monospace', 'Noto Mono', 'Oxygen Mono',
    'Liberation Mono', monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';

  /* Mono faces read large; use a slightly smaller size. */
  font-size: 0.875em;
}

code {
  word-wrap: break-word;
}

a > code {
  color: inherit;
}

pre code {
  font-size: inherit;
  color: inherit;
  word-break: normal;
}

/* Forms */
/* Form control reset: inheritance, sizing, and UA quirks. */

:where(html input, button, select, optgroup, textarea) {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

:where(html input, button, [type='radio'], [type='checkbox'], select, optgroup, textarea) {
  margin: 0;
}

:where(html input, select, textarea, legend) {
  width: 100%;
}

/* Shrink-to-content controls stay auto-width. */
:where(
  html label,
  button,
  [type='image'],
  [type='submit'],
  [type='reset'],
  html [type='button'],
  [type='radio'],
  [type='checkbox']
) {
  width: auto;
}

/* inline-block: consistent sizing and vertical-align across engines. */
:where(
  html input,
  label,
  select,
  textarea,
  button,
  html [type='button'],
  [type='reset'],
  [type='submit'],
  output
) {
  display: inline-block;
}

:where([type='file']) {
  display: block;
  background-color: transparent;
}

:where(button, html input, select, textarea) {
  background-image: none;
}

:where(input, select, textarea) {
  vertical-align: baseline;
}

:where(form) {
  margin: 0;
}

/* Drop fieldset min-content width so nested grids can shrink. */
:where(fieldset) {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

:where(legend) {
  display: table; /* Text wrapping in Edge / IE. */
  max-width: 100%;
  white-space: normal;
  border: 0;
  padding: 0;
  font-weight: 400;
  margin-bottom: var(--bf-spacing-md);
  font-size: inherit;
  line-height: 1.375;
  color: inherit;
}

:where(label) {
  font-weight: 400;
  font-size: 90%;
  line-height: 1.375;
  margin-bottom: var(--bf-spacing-md);
}

:where(label input, label select, label textarea) {
  font-size: 110%;
}

::-webkit-inner-spin-button {
  height: auto;
}

::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
  padding: 0;
}

::-webkit-color-swatch-wrapper {
  padding: 0;
}

:where([type='search']) {
  outline-offset: calc(-1 * var(--bf-spacing-sm));
}

:where(output) {
  vertical-align: middle;
}

:where(button, select) {
  text-transform: none;
}

:where(select) {
  word-wrap: normal;
}

/* Hide WebKit datalist picker chrome (Bootstrap Reboot 5.2).
 * https://unpkg.com/browse/bootstrap@5.2.0/dist/css/bootstrap-reboot.css */
:where([list]):not(
    [type='date'],
    [type='datetime-local'],
    [type='month'],
    [type='week'],
    [type='time']
  )::-webkit-calendar-picker-indicator {
  display: none !important;
}

:where(optgroup) {
  font-family: inherit;
  font-size: inherit;
  font-style: inherit; /* Families without a 600 face. */
  font-weight: 600;
}

/* Reset WebKit / Blink appearance on text-like controls. */
:where(
  button,
  html [type='button'],
  [type='reset'],
  [type='submit'],
  [type='email'],
  [type='number'],
  [type='text'],
  [type='tel'],
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='week'],
  [type='url'],
  [type='image'],
  [type='password'],
  [type='search'],
  [type='search']::-webkit-search-decoration,
  [type='search']::-webkit-search-cancel-button,
  input[list],
  textarea
) {
  -webkit-appearance: none;
          appearance: none;
}

::file-selector-button {
  font: inherit;
  -webkit-appearance: auto;
     -moz-appearance: auto;
          appearance: auto;
}

:where(button, input, select, textarea) {
  border-radius: var(--bf-spacing-sm);
}

:where([type='radio']) {
  border-radius: 50%;
}

:where([type='checkbox']) {
  border-radius: var(--bf-spacing-md);
}

:where([type='radio'], [type='checkbox']) {
  padding: 0;
  background-color: var(--bf-color-control-bg);
}

:where([type='range' i]) {
  background-color: transparent;
}

:where(select[size], select[multiple]) {
  height: auto;
}

:where(select[multiple]) {
  background-image: none;
}

:where(textarea) {
  height: auto;
  min-height: 60px;
  min-height: 6rem;
  overflow: auto;
  vertical-align: top;
  resize: vertical;
}

/* Firefox: strip inner focus padding/border. */
::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

:where(button, [type='button'], [type='reset'], [type='submit']) {
  line-height: normal;
  text-align: center;
  margin: 0;
  background-clip: padding-box;
  vertical-align: baseline;
  overflow: visible;
  -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  border: 0;
  background-image: none; /* Firefox mobile */
}

:where(button, [type='button'], [type='reset'], [type='submit']):hover,
:where(button, [type='button'], [type='reset'], [type='submit']):active,
:where(button, [type='button'], [type='reset'], [type='submit']):focus {
  text-decoration: none;
  color: var(--bf-color-on-neutral);
}

:where(
  button:not(:disabled),
  [type='button']:not(:disabled),
  [type='reset']:not(:disabled),
  [type='submit']:not(:disabled)
) {
  cursor: pointer;
}

/* Firefox: input color must not override placeholder color.
 * https://github.com/necolas/normalize.css/issues/150 */
:where(input::-moz-placeholder, textarea::-moz-placeholder) {
  color: var(--bf-color-placeholder);
}
:where(input::placeholder, textarea::placeholder) {
  color: var(--bf-color-placeholder);
}

/* Firefox: modern focus ring on all focusable elements. */
:-moz-focusring {
  outline: auto;
}

/* Firefox: drop :-moz-ui-invalid glow; use .bf-invalid for JS validation.
 * https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid */
:-moz-ui-invalid {
  box-shadow: none;
}
/* Form field and button chrome (borders, focus, disabled). */

:where(
  [type='email'],
  [type='number'],
  [type='password'],
  [type='tel'],
  [type='search'],
  [type='text'],
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='week'],
  [type='time'],
  [type='url'],
  input[list],
  select,
  textarea
) {
  background-color: var(--bf-color-field-bg);
  border: 1px solid var(--bf-color-field-border);
  padding: var(--bf-spacing-md) calc(var(--bf-spacing-lg) * 0.75);
}

:where(
  [type='email'],
  [type='number'],
  [type='password'],
  [type='tel'],
  [type='search'],
  [type='text'],
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='week'],
  [type='time'],
  [type='url'],
  input[list],
  select,
  textarea
):active,
:where(
  [type='email'],
  [type='number'],
  [type='password'],
  [type='tel'],
  [type='search'],
  [type='text'],
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='week'],
  [type='time'],
  [type='url'],
  input[list],
  select,
  textarea
):focus {
  transition:
    border 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
  border-color: var(--bf-color-field-border-focus, var(--bf-color-primary));
  box-shadow: 0 0 0 3px var(--bf-color-field-shadow-focus);
}

/* Radio / checkbox keep the primary ring in every scheme. */
:where([type='radio'], [type='checkbox']):active,
:where([type='radio'], [type='checkbox']):focus {
  transition:
    border 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
  border-color: var(--bf-color-primary);
  box-shadow: 0 0 0 3px rgb(0 86 179 / 25%);
}

:where(button, [type='button'], [type='reset'], [type='submit']) {
  color: var(--bf-color-on-neutral);
  padding: calc(var(--bf-spacing-xl) / 3) calc(calc(var(--bf-spacing-xl) / 3) * 2);
  background: var(--bf-color-neutral);
  transition:
    color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

:where(button, [type='button'], [type='reset'], [type='submit']):hover,
:where(button, [type='button'], [type='reset'], [type='submit']):active,
:where(button, [type='button'], [type='reset'], [type='submit']):focus:not(.bf-disabled):not(
    [aria-disabled='true']
  ) {
  text-decoration: none;
  color: var(--bf-color-on-neutral);
  background: var(--bf-color-neutral-hover);
}

:where(button, [type='button'], [type='reset'], [type='submit']):active,
:where(button, [type='button'], [type='reset'], [type='submit']):focus:not(.bf-disabled):not(
    [aria-disabled='true']
  ) {
  box-shadow: 0 0 0 3px var(--bf-color-button-shadow-focus);
}

/* Disabled / aria-disabled / fieldset[disabled]. */
:where(
  fieldset[disabled] button,
  fieldset[disabled] input,
  fieldset[disabled] input::after,
  fieldset[disabled] input::before,
  fieldset[disabled] input:checked,
  fieldset[disabled] select,
  fieldset[disabled] textarea,
  fieldset[disabled] label,
  button[disabled],
  input[disabled],
  input[disabled]::after,
  input[disabled]::before,
  input[disabled]:checked,
  select[disabled],
  textarea[disabled],
  label[disabled],
  button:disabled,
  input:disabled,
  input:disabled::after,
  input:disabled::before,
  input:disabled:checked,
  select:disabled,
  textarea:disabled,
  label:disabled,
  button[aria-disabled='true'],
  input[aria-disabled='true'],
  input[aria-disabled='true']::after,
  input[aria-disabled='true']::before,
  input[aria-disabled='true']:checked,
  select[aria-disabled='true'],
  textarea[aria-disabled='true'],
  label[aria-disabled='true']
) {
  cursor: default !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
          user-select: none !important;
  box-shadow: none !important;
  opacity: 0.5 !important;
}
/* Select: custom arrow for single-value controls.
 * Skip [size] / [multiple] (native UI differs by engine). Inspired by water.css. */

:where(select):not([size], select[multiple]) {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background: var(--bf-color-field-bg)
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e")
    no-repeat right 0.85rem center/8px 10px;
  padding-right: calc(var(--bf-spacing-lg) + var(--bf-spacing-lg));
}

/* RTL: mirror arrow after appearance:none removes the native control. */
:where(*[dir='rtl']) :where(select):not([size], select[multiple]),
:where(select[dir='rtl']):not([size], select[multiple]) {
  background-position: left 0.85rem top 50%;
  padding-right: calc(var(--bf-spacing-lg) * 0.75);
  padding-left: calc(var(--bf-spacing-lg) + var(--bf-spacing-lg));
}
/* Range: custom thumb/track when appearance:none is supported.
 * CodePen: https://codepen.io/marcop135/pen/JjGrNMx */

@supports ((-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none)) {
  :where([type='range']) {
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    width: 100%;
    height: 1.4rem;
  }

  :where([type='range'])::-webkit-slider-thumb {
    border: 0;
    -webkit-appearance: none;
            appearance: none;

    width: 1.5rem;
    height: 1.5rem;
    margin-top: -0.25rem;
    background-color: var(--bf-color-primary);
    border-radius: 1.5rem;
    -webkit-transition:
      background-color 0.15s ease-in-out,
      border-color 0.15s ease-in-out,
      box-shadow 0.15s ease-in-out;
    transition:
      background-color 0.15s ease-in-out,
      border-color 0.15s ease-in-out,
      box-shadow 0.15s ease-in-out;
  }

  :where([type='range'])::-webkit-slider-thumb:active {
    background-color: var(--bf-color-primary);
  }

  :where([type='range'])::-moz-range-thumb {
    border: 0;
    -moz-appearance: none;
         appearance: none;

    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--bf-color-primary);
    border-radius: 1.5rem;
    -moz-transition:
      background-color 0.15s ease-in-out,
      border-color 0.15s ease-in-out,
      box-shadow 0.15s ease-in-out;
    transition:
      background-color 0.15s ease-in-out,
      border-color 0.15s ease-in-out,
      box-shadow 0.15s ease-in-out;
  }

  :where([type='range'])::-moz-range-thumb:active {
    background-color: var(--bf-color-primary);
  }

  :where([type='range'])::-webkit-slider-runnable-track {
    color: transparent;
    border-color: transparent;

    width: 100%;
    height: 0.65rem;
    cursor: pointer;
    background-color: var(--bf-color-range-track);
  }

  :where([type='range'])::-moz-range-track {
    color: transparent;
    border-color: transparent;

    width: 100%;
    height: 0.65rem;
    cursor: pointer;
    background-color: var(--bf-color-range-track);
  }

  :where([type='range']):focus {
    outline: none;
  }

  :where([type='range']):focus::-webkit-slider-thumb {
    box-shadow:
      0 0 0 0.1rem var(--bf-color-control-bg),
      0 0 0 0.2rem rgb(0 123 255 / 25%);
  }

  :where([type='range']):focus::-moz-range-thumb {
    box-shadow:
      0 0 0 0.1rem var(--bf-color-control-bg),
      0 0 0 0.2rem rgb(0 123 255 / 25%);
  }

  :where([type='range'])::-moz-focus-outer {
    border: 0;
  }

  :where([type='range']):disabled {
    pointer-events: none;
  }

  :where([type='range']):disabled::-webkit-slider-thumb {
    background-color: var(--bf-color-neutral);
  }

  :where([type='range']):disabled::-moz-range-thumb {
    background-color: var(--bf-color-neutral);
  }
}

/* Miscellaneous */
/* Link defaults. --bf-color-primary meets WCAG AA 4.5:1 on --bf-color-bg. */

a {
  color: var(--bf-color-link, var(--bf-color-primary));
  text-decoration: none;
  background-color: transparent; /* Legacy Edge active background. */
}

a:hover,
a:focus {
  text-decoration: underline;
  color: var(--bf-color-link-hover, var(--bf-color-primary-hover));
}

/* Non-href anchors inherit text (Bootstrap reboot pattern). */
a:not([href], [tabindex]) {
  color: inherit;
  text-decoration: none;
}

a:not([href], [class]),
a:not([href], [class]):hover {
  color: inherit;
  text-decoration: none;
}

a:not([href], [tabindex]):focus {
  outline: 0;
}
/* Keyboard-first focus: :focus-visible ring from --bf-focus-ring-*; mute mouse outline.
 * Text-like controls clear UA outline here; field chrome is in forms/styling.css. */

:where(:focus:not(:focus-visible)) {
  outline: none;
}

/* tabindex="-1" targets should not show a ring on programmatic focus. */
:where([tabindex='-1']:focus:not(:focus-visible)) {
  outline: 0 !important;
}

:focus-visible {
  outline: var(--bf-focus-ring-width) solid var(--bf-color-focus-ring);
  outline-offset: var(--bf-focus-ring-offset);
}

/* Clear UA outline on text-like controls (styled fields keep their own chrome).
 * Buttons, radios and checkboxes keep the :focus-visible ring.
 * Leave color / range / file alone; they often use custom widgets. */
[type='email']:focus,
[type='number']:focus,
[type='password']:focus,
[type='tel']:focus,
[type='search']:focus,
[type='text']:focus,
[type='date']:focus,
[type='datetime-local']:focus,
[type='month']:focus,
[type='time']:focus,
[type='week']:focus,
[type='url']:focus,
input[list]:focus,
select:focus,
textarea:focus {
  outline: 0;
}

/* aria-disabled controls stay focusable, so keep the ring (disabled rules drop box-shadow). */
[aria-disabled='true']:focus-visible {
  outline: var(--bf-focus-ring-width) solid var(--bf-color-focus-ring);
  outline-offset: var(--bf-focus-ring-offset);
}
/* List spacing and nav list reset. */

menu,
ol,
ul,
dl {
  margin: 0 0 var(--bf-spacing-xl) 0;
  padding: 0;
}

menu ul,
menu ol,
ul ul,
ul ol,
ol ol,
ol ul,
dd {
  margin-bottom: 0;
}

ul,
ol {
  margin-left: var(--bf-spacing-xl);
}

nav ol,
nav ul {
  list-style: none;
  margin-left: 0;
}

dt {
  font-weight: 700;
}

dd {
  margin-left: 0;
}

/* VoiceOver: zero-width space so list-style:none lists stay announced. */
nav li::before {
  content: '\200B';
  position: absolute;
}
/* Media elements, figures, progress/meter, and iframes. */

audio,
canvas,
progress,
video {
  display: inline-block;
}

img,
canvas,
audio,
video,
iframe,
object,
embed {
  max-width: 100%;
}

audio,
video,
canvas,
img,
svg {
  vertical-align: middle;
}

img {
  height: auto;
  border-style: none;
}

figure {
  margin: 0;
}

figure,
figcaption {
  display: block;
}

figcaption {
  line-height: 1.375;
  font-size: 90%;
}

video {
  height: auto;
}

audio {
  width: 100%;
}

audio:not([controls]) {
  display: none;
  height: 0;
}

svg:not(:root) {
  overflow: hidden;
}

svg:not([fill]) {
  fill: currentColor;
}

progress,
meter {
  display: inline-block;
  vertical-align: baseline;
  width: 100%;
  max-width: 100%;
}

/* progress[value] reset (https://css-tricks.com/html5-progress-element/). */
progress[value] {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: none; /* Firefox default border. */

  height: 20px;
  height: 2rem;

  background: var(--bf-color-progress-track);
  color: var(--bf-color-primary); /* Progress fill in IE10+. */
}

progress[value]::-webkit-progress-bar {
  background: var(--bf-color-progress-track);
}

progress[value]::-webkit-progress-value {
  background: var(--bf-color-primary);
}

/* No default border (covers embeds that ignore frameborder="0"). */
iframe {
  border-style: none;
}
/* Address, details/summary, and dialog defaults. */

address {
  font-style: normal;
  margin-bottom: var(--bf-spacing-lg);
  line-height: inherit;
}

details > summary:first-of-type {
  display: list-item;
}

summary {
  cursor: pointer;
  font-weight: 700;
  word-break: break-all;
}

dialog {
  background-color: var(--bf-color-bg);
  color: var(--bf-color-text);
  border: none;
  border-radius: var(--bf-spacing-sm);
  padding: var(--bf-spacing-xl);
  height: -moz-fit-content;
  height: fit-content;
  min-width: min(25rem, 100%);
  max-width: calc(100vw - (var(--bf-spacing-grid-gutter) * 2));
}

@media (min-width: 768px) {
  dialog {
    max-width: 50rem;
  }
}

/* Open dialog wins over [hidden] (e.g. <dialog hidden open>). */
dialog[open] {
  display: block !important;
}

dialog::backdrop {
  background: rgb(0 0 0 / 40%);
}
/* Smooth scrolling when motion is allowed. */

@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}
/* Table border collapse and cell alignment. */

table {
  caption-side: bottom;
  max-width: 100%;
  border-collapse: collapse;
  border-color: currentcolor; /* Chrome / Safari inheritance. */
  text-indent: 0; /* Chrome / Safari table indent. */
}

thead,
tbody,
tfoot,
tr,
td,
th {
  border-color: inherit;
  border-style: solid;
  border-width: 0;
}

thead th {
  vertical-align: bottom;
}

th,
td {
  vertical-align: top;
}

th {
  text-align: inherit;
  text-align: -webkit-match-parent;
  font-weight: 700;
}

caption {
  padding-top: var(--bf-spacing-md);
  padding-bottom: var(--bf-spacing-md);
  color: var(--bf-color-caption);
  text-align: left;
  caption-side: bottom;
  line-height: 1.375;
  font-size: 90%;
}
/* Accessibility helpers (adapted from sanitize.css). */

/* Busy: progress cursor. */
:where([aria-busy='true' i]) {
  cursor: progress;
}

/* Disabled / inoperable: not-allowed cursor. */
:where([aria-disabled='true' i], [disabled]) {
  cursor: not-allowed;
}

/* aria-hidden="false" on [hidden]: keep in a11y tree when not focused. */
:where([aria-hidden='false' i][hidden]) {
  display: initial;
}

:where([aria-hidden='false' i][hidden]:not(:focus)) {
  clip: rect(0, 0, 0, 0);
  position: absolute;
}
/* Preference queries only (prefers-contrast, forced-colors). Additive. */

/* prefers-contrast: more: underline links, thicker focus, stronger borders (WCAG 1.4.1). */
@media (prefers-contrast: more) {
  a {
    text-decoration: underline;
  }

  /* Darker amber clears WCAG 1.4.11 (3:1) on the light and dark --bf-color-bg;
   * the default orange ring is only ~2:1 on white. */
  :root {
    --bf-color-focus-ring: rgb(184 115 0);
  }

  :focus-visible {
    outline-width: 0.3rem;
    outline-offset: 0.4rem;
  }

  [type='email'],
  [type='number'],
  [type='password'],
  [type='tel'],
  [type='search'],
  [type='text'],
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='time'],
  [type='url'],
  [type='week'],
  input[list],
  select,
  textarea {
    border-width: 2px;
  }
}

/* forced-colors: restore focus via Highlight; underline links; keep button borders. */
@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }

  /* Fields hide the ring for border + box-shadow, which forced colours drop.
   * Same list as the outline reset in focus.css. */
  :is(
    [type='email'],
    [type='number'],
    [type='password'],
    [type='tel'],
    [type='search'],
    [type='text'],
    [type='date'],
    [type='datetime-local'],
    [type='month'],
    [type='time'],
    [type='week'],
    [type='url'],
    input[list],
    select,
    textarea
  ):focus {
    outline: 2px solid Highlight;
  }

  a {
    text-decoration: underline;
  }

  /* Keep button borders so disabled/active stay distinguishable. */
  button,
  [type='button'],
  [type='reset'],
  [type='submit'] {
    border: 1px solid ButtonText;
  }
}
