.license-document-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(15, 98, 91, 0.34);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.license-document-link:hover {
  color: #0f625b;
  text-decoration-color: currentColor;
}

.license-document-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid #d9ef79;
  outline-offset: 4px;
}

.license-modal {
  width: min(1100px, calc(100% - 32px));
  max-width: none;
  height: min(860px, calc(100dvh - 32px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 49, 47, 0.14);
  border-radius: 28px;
  background: #f6f5ed;
  color: #17312f;
  box-shadow: 0 30px 90px rgba(9, 37, 35, 0.3);
}

.license-modal::backdrop {
  background: rgba(9, 37, 35, 0.78);
  backdrop-filter: blur(8px);
}

.license-modal__layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.license-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(23, 49, 47, 0.12);
  background: #fff;
}

.license-modal__eyebrow {
  margin: 0 0 5px;
  color: #0f625b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.license-modal__title {
  margin: 0;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.license-modal__meta {
  margin: 7px 0 0;
  color: rgba(23, 49, 47, 0.62);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.license-modal__close {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(23, 49, 47, 0.12);
  border-radius: 50%;
  background: #f6f5ed;
  color: #17312f;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
}

.license-modal__close:hover {
  transform: rotate(4deg);
  background: #d9ede7;
}

.license-modal__close:focus-visible,
.license-modal__action:focus-visible {
  outline: 3px solid #d9ef79;
  outline-offset: 3px;
}

.license-modal__body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 14px;
}

.license-modal__viewer {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid rgba(23, 49, 47, 0.12);
  border-radius: 18px;
  background: #fff;
}

.license-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 0;
}

.license-modal__hint {
  margin: 0;
  color: rgba(23, 49, 47, 0.58);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.license-modal__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 999px;
  background: #0f625b;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.license-modal__action:hover {
  transform: translateY(-1px);
  background: #093f3b;
}

html.is-license-modal-open,
html.is-license-modal-open body {
  overflow: hidden;
}

html.is-accessible .license-modal {
  border: 3px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
}

html.is-accessible .license-modal__header,
html.is-accessible .license-modal__viewer {
  border-color: #000;
  background: #fff;
}

html.is-accessible .license-modal__eyebrow,
html.is-accessible .license-modal__meta,
html.is-accessible .license-modal__hint {
  color: #000;
}

html.is-accessible .license-modal__action,
html.is-accessible .license-modal__close {
  border: 2px solid #000;
  background: #000;
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .license-modal {
    width: calc(100% - 16px);
    height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .license-modal__header {
    gap: 12px;
    padding: 17px 16px;
  }

  .license-modal__meta {
    font-size: 11px;
  }

  .license-modal__close {
    width: 40px;
    height: 40px;
  }

  .license-modal__body {
    padding: 8px;
  }

  .license-modal__viewer {
    min-height: 280px;
    border-radius: 14px;
  }

  .license-modal__actions {
    align-items: stretch;
    padding: 10px 4px 2px;
  }

  .license-modal__hint {
    width: 100%;
  }

  .license-modal__action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .license-document-link,
  .license-modal__close,
  .license-modal__action {
    transition: none;
  }
}
