.document-template-dialog {
  width: min(1040px, calc(100vw - 24px));
  max-width: none;
}

.document-template-dialog-panel {
  width: 100%;
  max-width: none;
}

.document-template-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}

.document-template-option {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 2px solid #c8d5d9;
  border-radius: 12px;
  background: #fff;
  color: #17343d;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.document-template-option:hover {
  border-color: #4b9ca3;
  transform: translateY(-1px);
}

.document-template-option:has(input:checked) {
  border-color: #087a84;
  box-shadow: 0 0 0 3px rgba(8, 122, 132, 0.14), 0 12px 28px rgba(16, 45, 54, 0.13);
}

.document-template-option input {
  position: absolute;
  inset: 12px auto auto 12px;
  z-index: 2;
  width: 20px;
  height: 20px;
  accent-color: #087a84;
}

.document-template-preview {
  position: relative;
  display: grid;
  min-height: 160px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #d6e0e3;
  background: #eef4f5;
}

.document-template-preview img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top center;
}

.document-template-preview > img.document-template-icon {
  width: 58px;
  height: 58px;
  padding: 12px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  filter: invert(28%) sepia(29%) saturate(1613%) hue-rotate(137deg) brightness(90%) contrast(93%);
  box-shadow: 0 8px 22px rgba(16, 45, 54, 0.13);
}

.document-template-preview.template-preview-executive {
  border-top: 18px solid #083a43;
  background: #f6f8f8;
}

.document-template-preview.template-preview-clean {
  border-top: 8px solid #168b91;
  background: #fff;
}

.document-template-copy {
  display: grid;
  gap: 5px;
  padding: 15px 16px 17px;
}

.document-template-copy strong {
  font-size: 15px;
}

.document-template-copy small {
  color: #5e737a;
  font-size: 12px;
  line-height: 1.4;
}

.document-template-copy em {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e3f4f4;
  color: #08737b;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.document-template-select {
  display: grid;
  gap: 6px;
  margin: 16px 0;
}

.document-template-select > span {
  color: #17343d;
  font-weight: 800;
}

.document-template-select > small {
  color: #657980;
}

@media (max-width: 760px) {
  .document-template-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .document-template-dialog-panel {
    max-height: calc(100dvh - 12px);
    overflow-y: auto;
  }

  .document-template-options {
    grid-template-columns: 1fr;
  }

  .document-template-option {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .document-template-preview {
    min-height: 132px;
    border-right: 1px solid #d6e0e3;
    border-bottom: 0;
  }

  .document-template-preview img {
    height: 132px;
  }
}
