.pdf-template-type-picker {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pdf-template-type-picker legend {
  margin: 0 0 8px;
  padding: 0;
  color: var(--text, #18283a);
  font-size: 13px;
  font-weight: 800;
}

.pdf-template-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid .pdf-template-type-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.pdf-template-type-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pdf-template-type-option span {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid #d7e1ec;
  border-radius: 12px;
  color: #4b5e73;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease,
    box-shadow 140ms ease, transform 140ms ease;
}

.pdf-template-type-option:hover span {
  border-color: #9ab8f7;
  background: #f2f6ff;
}

.pdf-template-type-option input[type="radio"]:checked + span {
  border-color: #3d78ed;
  color: #1f5fd4;
  background: #eaf1ff;
  box-shadow: 0 0 0 2px rgba(61, 120, 237, 0.12);
}

.pdf-template-type-option input[type="radio"]:focus-visible + span {
  outline: 3px solid rgba(61, 120, 237, 0.28);
  outline-offset: 2px;
}

.form-grid .pdf-template-custom-category {
  display: none;
  width: 100%;
  margin-top: 8px;
}

.pdf-template-type-option input[type="radio"]:checked ~ .pdf-template-custom-category {
  display: block;
}

body.theme-dark .pdf-template-type-picker legend {
  color: #eaf3ff;
}

body.theme-dark .pdf-template-type-option span {
  border-color: #294866;
  color: #c4d4e5;
  background: #0d2137;
}

body.theme-dark .pdf-template-type-option:hover span {
  border-color: #4d7fbe;
  background: #13304e;
}

body.theme-dark .pdf-template-type-option input[type="radio"]:checked + span {
  border-color: #60a5fa;
  color: #fff;
  background: #2563eb;
}

@media (max-width: 760px) {
  .pdf-template-type-options {
    grid-template-columns: 1fr;
  }
}
