/* The approved trash button, shared by the static shell and React Button. */
:root {
  --kolegin-delete-size: 44px;
  --kolegin-delete-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c2c2c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M19 6v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M10 10v7M14 10v7'/%3E%3C/svg%3E");
}

:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  ) {
  appearance: none;
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--kolegin-delete-size) !important;
  width: var(--kolegin-delete-size) !important;
  min-width: var(--kolegin-delete-size) !important;
  max-width: var(--kolegin-delete-size) !important;
  height: var(--kolegin-delete-size) !important;
  min-height: var(--kolegin-delete-size) !important;
  max-height: var(--kolegin-delete-size) !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: calc(var(--kolegin-delete-size) / 4) !important;
  background: var(--kolegin-disclosure-surface, #ececec)
    var(--kolegin-delete-icon) center / 45% 45% no-repeat !important;
  color: var(--kolegin-disclosure-ink, #2c2c2c) !important;
  box-shadow: none !important;
  /* Keep the original text and accessible name, including pending states. */
  font-size: 0 !important;
  line-height: 0 !important;
  text-indent: 0;
  overflow: hidden;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
}

:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  ):is(:hover, :active):not(:disabled):not([aria-disabled="true"]) {
  background-color: #e5e5e5 !important;
}

:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  ):focus-visible {
  outline: 2px solid var(--kolegin-disclosure-ink, #2c2c2c);
  outline-offset: 3px;
}

:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  ):is(:disabled, [aria-disabled="true"]) {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Do not let the shared display rule reveal a permission-gated action. */
:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  )[hidden] {
  display: none !important;
}

/* Remove the old decorative circle used by home-screen delete controls. */
:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  )::before,
:root
  button:is(
    [data-ui-delete],
    .ui-delete-button,
    [aria-label^="Удалить"],
    [aria-label^="удалить"]
  )::after {
  content: none !important;
}

@media (forced-colors: active) {
  :root
    button:is(
      [data-ui-delete],
      .ui-delete-button,
      [aria-label^="Удалить"],
      [aria-label^="удалить"]
    ) {
    forced-color-adjust: none;
    outline-color: Highlight;
  }
}
