body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h2 {
  font-size: 40px;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.modal-subtitle {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 16px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  align-self: flex-start;
}

.modal-body {
  padding: 18px 22px;
  overflow: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.modal-shell[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.address-edit-modal__dialog {
  min-height: 0;
}

.address-edit-modal__info-box {
  background: #eaf2ff;
  border: 1px solid #c5d8f5;
  border-radius: 12px;
  padding: 18px;
}

.address-edit-modal__info-title {
  margin: 0 0 6px;
  color: #1d4ed8;
  font-weight: 700;
}

.address-edit-modal__info-box p {
  margin: 0;
}

.address-edit-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.address-edit-modal .field {
  margin: 0;
}

.address-edit-modal .field__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.address-edit-modal input,
.address-edit-modal select,
.address-edit-modal textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}

.address-edit-modal textarea {
  resize: vertical;
}

.address-edit-modal__primary {
  margin-top: 2px;
}

.modal-footer .btn {
  min-width: 180px;
}

@media (max-width: 768px) {
  .modal-header h2 {
    font-size: 30px;
  }

  .address-edit-modal__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .modal-shell {
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
    min-width: 0;
  }
}
