.custom-item {
  width: min(32rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}

.custom-item::backdrop { background: rgba(24, 0, 63, .55); }

.custom-item__form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.25rem, 5vw, 2rem);
}

.custom-item__title {
  margin: 0 0 .25rem;
  font: 700 clamp(1.75rem, 5vw, 2.25rem)/1.1 var(--serif);
}

.custom-item__field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  min-width: 0;
}

.custom-item__field label {
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 650;
}

.custom-item__optional {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 400;
}

.custom-item__field input,
.custom-item__field select {
  width: 100%;
  min-height: 2.875rem;
  padding: .5rem .75rem;
  border: 1px solid var(--field);
  border-radius: .5rem;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
}

.custom-item__field input::placeholder { color: var(--muted); }
.custom-item__field select { text-overflow: ellipsis; }
.custom-item__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.custom-item__currency { position: relative; }
.custom-item__currency input { padding-left: 1.75rem; }
.custom-item__currency > span {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  pointer-events: none;
}

.custom-item__note { margin: 0; color: var(--ink-2); font-size: .875rem; line-height: 1.4; }
.custom-item__field[hidden] { display: none; }
.custom-item__field select:disabled { background: var(--lilac); opacity: 1; }

.custom-item__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 28rem) {
  .custom-item__pair { grid-template-columns: 1fr; gap: 1.25rem; }
}
