.atlas-date-field { position: relative; display: flex; }
.atlas-date-field > input { width: 100% !important; min-width: 0 !important; }
.atlas-date-field::before {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.5;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}
.atlas-date-field.has-value::before { display: none; }
.atlas-date-field:not(.has-value) > input[type="date"] { color: transparent !important; }
.atlas-date-field:not(.has-value) > input::-webkit-datetime-edit { opacity: 0; }

/* Firefox använder datumfältets färg även för kalenderikonen. Behåll dess plats synlig utan att täcka den klickbara kontrollen. */
@supports (-moz-appearance: none) {
  .atlas-date-field:not(.has-value)::after {
    content: '';
    position: absolute;
    inset-inline-end: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    pointer-events: none;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
