.id-modal-overlay {
  --id-modal-gap: 8px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { background-color: rgba(0, 0, 0, 0); }
  to { background-color: rgba(0, 0, 0, 0.6); }
}

.id-modal-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0px 12px 24px rgba(112, 144, 176, 0.14);
  width: fit-content;
  max-width: 92vw;
  min-width: 0;
  height: auto;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #E0E5F2;
  padding: 12px;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.id-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.id-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1f2329;
  letter-spacing: -0.2px;
}

.id-modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
  pointer-events: auto !important;
}

.id-modal-close-btn:hover {
  color: #111827;
  transform: scale(1.06);
}

.id-modal-body {
  padding: 12px;
  padding-left: var(--id-modal-gap);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.id-modal-grid {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: var(--id-modal-gap);
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

.id-modal-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.id-modal-label {
  font-size: 12px;
  font-weight: 600;
  color: #1f2329;
  margin-bottom: 8px;
  display: block;
  line-height: 1.35;
  min-height: 28px;
}

.id-modal-textarea {
  flex: 1;
  min-height: 124px;
  max-height: 240px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: 'Courier New', Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  background: #ffffff;
  color: #1f2329;
}

#id-modal-textarea,
#id-modal-found,
#id-modal-missing {
  width: clamp(20ch, 24vw, 26ch);
  max-width: 100%;
}

.id-modal-textarea::placeholder {
  color: #d1d5db;
  font-size: 12px;
}

.id-modal-textarea:focus {
  border-color: #2f67e0;
  box-shadow: 0 0 0 4px rgba(47, 103, 224, 0.15), inset 0 0 0 1px rgba(47, 103, 224, 0.1);
  background: #fafbff;
}

.id-modal-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  border-left: 3px solid #2f67e0;
}

.id-modal-footer {
  padding: 10px 14px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: #ffffff;
}

.id-modal-footer .btn {
  min-width: 80px;
  font-size: 12px;
}

@media (max-width: 1024px) {
  .id-modal-grid {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
  }

  .id-modal-label {
    min-height: 0;
  }

  #id-modal-textarea,
  #id-modal-found,
  #id-modal-missing {
    width: 100%;
  }
}

#id-modal-select { background: #2f67e0; color: #ffffff; }
#id-modal-filter { background: #ef4444; color: #ffffff; }
#id-modal-cancel { background: #6b7280; color: #ffffff; }
