dialog.datasheet-modal {
  width: min(960px, calc(100vw - 2rem));
  max-width: 960px;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: #173b28;
  background: transparent;
  box-shadow: 0 24px 90px rgba(11, 31, 20, .28);
  overflow: hidden;
}

dialog.datasheet-modal::backdrop {
  background: rgba(12, 28, 20, .58);
  backdrop-filter: blur(2px);
}

.datasheet-modal__card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 2rem);
  background: #fff;
}

.datasheet-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #d6e7da;
}

.datasheet-modal__title {
  min-width: 0;
  margin: 0;
  color: #173b28;
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.datasheet-modal__sku {
  display: block;
  margin-top: .3rem;
  color: #607267;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.datasheet-modal__close {
  flex: 0 0 auto;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: .35rem .6rem;
  border: 1px solid #c8dccd;
  border-radius: 10px;
  color: #173b28;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
}

.datasheet-modal__close:hover {
  border-color: #278846;
  background: #eef7f0;
}

.datasheet-modal__body {
  overscroll-behavior: contain;
  min-height: 0;
  padding: 1.2rem 1.35rem 1.35rem;
  overflow: auto;
}

.datasheet-modal__loading,
.datasheet-modal__message,
.datasheet-modal__meta {
  margin: 0;
  color: #607267;
  line-height: 1.55;
}

.datasheet-modal__meta {
  margin-bottom: .9rem;
  font-size: .88rem;
  font-weight: 700;
}

.datasheet-modal__viewer {
  min-height: 240px;
  height: min(68vh, 680px);
  border: 1px solid #d6e7da;
  border-radius: 12px;
  background: #f4f8f5;
  overflow: hidden;
}

.datasheet-modal__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.datasheet-modal__actions,
.datasheet-modal__state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}
.datasheet-modal__actions{margin-top:0;margin-bottom:1rem}

.datasheet-modal__state {
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid #d6e7da;
  border-radius: 12px;
  background: #eef7f0;
}

.datasheet-modal__state .datasheet-modal__message {
  flex: 1 1 100%;
}

.datasheet-modal__button,
.datasheet-modal__text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem .9rem;
  border-radius: 10px;
  font: inherit;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.datasheet-modal__button {
  border: 1px solid #278846;
  color: #fff;
  background: #278846;
}

.datasheet-modal__button:hover {
  border-color: #1d6d38;
  color: #fff;
  background: #1d6d38;
}

.datasheet-modal__text-link {
  min-height: 36px;
  padding-inline: .2rem;
  color: #1d6d38;
  text-decoration: underline;
  text-underline-offset: .16em;
}

dialog.datasheet-modal :is(a, button):focus-visible {
  outline: 3px solid rgba(39, 136, 70, .3);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  dialog.datasheet-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 14px;
  }

  .datasheet-modal__card {
    max-height: calc(100dvh - 1rem);
  }

  .datasheet-modal__header,
  .datasheet-modal__body {
    padding: .9rem;
  }

  .datasheet-modal__viewer {
    height: min(64dvh, 560px);
  }

  .datasheet-modal__actions,
  .datasheet-modal__state {
    align-items: stretch;
  }

  .datasheet-modal__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.datasheet-modal::backdrop {
    backdrop-filter: none;
  }
}
