/* The existing SVG roots retain their canvases, transforms, accessibility and
   pointer targets. Dynamic rings are excluded by the presentation adapter. */
@media not (forced-colors: active) {
  html.nawras-platform svg[data-nawras-icon] {
    background-image: var(--nawras-icon-image) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }
  html.nawras-platform svg[data-nawras-icon] > :not(title):not(desc) { opacity: 0 !important; }
}
/* In forced colors our SVG paint/suppression rules do not apply. The original
   geometry, currentColor and each source child's own opacity remain intact. */
html.nawras-platform img[data-nawras-logo] { object-fit: contain; filter: none !important; }

/* A group replaces one original text node, retaining its anonymous flex item.
   The original character still supplies width, line metrics and accessible
   wording; only its ink is transparent. Artwork fits within that advance. */
html.nawras-platform [data-nawras-text-group],
html.nawras-platform [data-nawras-text-glyph] {
  display: inline;
  font: inherit;
  line-height: inherit;
  white-space: inherit;
  pointer-events: none;
}
html.nawras-platform [data-nawras-text-glyph] {
  position: relative;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
html.nawras-platform [data-nawras-text-glyph]::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--nawras-text-image);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Existing generated checks keep their original content and inline advance. */
html.nawras-platform [data-nawras-pseudo-before]::before {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background-image: var(--nawras-pseudo-before-image) !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}
html.nawras-platform [data-nawras-pseudo-after]::after {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background-image: var(--nawras-pseudo-after-image) !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* Only the arrow image changes. Existing repeat, size, position, padding,
   native selection behavior and option lists remain source-owned. */
html.nawras-platform select[data-nawras-select] {
  background-image: var(--nawras-select-image) !important;
}

/* The actual input remains focusable and interactive. Its original measured
   width/height are retained when replacing native paint. :checked follows the
   native state directly, without synthetic clicks or mirrored checked values.
   No opacity is added: source disabled opacity applies exactly once. */
html.nawras-platform input[data-nawras-native] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: var(--nawras-native-width) !important;
  height: var(--nawras-native-height) !important;
  border-color: transparent !important;
  background-color: transparent !important;
  background-image: var(--nawras-native-unchecked) !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}
html.nawras-platform input[data-nawras-native]:checked {
  background-image: var(--nawras-native-checked) !important;
}
html.nawras-platform input[data-nawras-native]:indeterminate {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  background-image: none !important;
}

@media (forced-colors: active) {
  html.nawras-platform input[data-nawras-native] {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    background-image: none !important;
    border-color: ButtonText !important;
  }
  html.nawras-platform [data-nawras-text-glyph],
  html.nawras-platform [data-nawras-pseudo-before]::before,
  html.nawras-platform [data-nawras-pseudo-after]::after {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    background-image: none !important;
  }
  html.nawras-platform [data-nawras-text-glyph]::after { background-image: none !important; }
}
